For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Visual3D_Layer DrawText problem

Marco Balen's picture

I am converting an app from OCC6.3 to OCC6.6.
I have recompiled all the OCC sources and my app with VS2010 using the msvc.bat file provided.
I have a compilation problem using the DrawText method of the Visual3D_Layer class.
When I try to use the original code
myLayer->DrawText("any text",anyX,anyY,anyH);
I get a compiler error the tell me that there is no method "DrawText" for that class.

In the methods list I can see an "DrawTextA" method; Using this method I can compile the source code but I get a linker error that reports that there is no DrawtextA method fro the class Visual3D_Layer.

Introducing a remark to this line the app can be linked and seem works correctly. (without the text)

I am compiling my code with MultiByte option.

Have anyone a suggestion ?

François Lauzon's picture

Hello Marco,
for me the method DrawText has always work, no compiler error, I currently use OCC Release 6.5.4.


Marco Balen's picture

Also for me it works in OCC6.3.0 and VC2010.
I think I have a problem when building the OCC library.
It seem that the method exported in the tkv3d.lib uses a wrong type of character code (unicode,multibyte, undefined ?).
I am building my app with MFC,without ATL,in multibyte, and you ?

François Lauzon's picture

We are using the supplied vcproj file without any modification and have been compiling on VC2005 and VC2008, in 32 and 64 bits, on Windows XP and 7.

Marco Balen's picture

Have anyone used the OCC6.6.0 with VS2010 ?

Thorsten's picture


I am getting the same linker error using DrawTextW. I managed it by using the graphic drivers "Text" Method.

Somewhere you created your V3D_Viewer like this:
Handle(Graphic3d_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver ("TKOpenGl");
aGraphicDriver->Begin (new Aspect_DisplayConnection());
TCollection_ExtendedString aNameOfViewer ("Visu3D");
Handle(V3d_Viewer) aViewer = new V3d_Viewer(
aGraphicDriver, aName, aDomain, ViewSize, ViewProj,
ComputedMode, aDefaultComputedMode, V3d_TEX_NONE);

Now you can call the graphic drivers Text Method directly:
aViewer->Driver()->Text("Hello World!", 100, 100, 20);