Now works with OpenCASCADE 5.0

I have updated the ImproveCascade.cpp file so that it now works properly on Open CASCADE version 5.0. Follow the link to download the latest version of ImproveCascade.cpp.

-- Conrad

Patrik Mueller's picture

Hi,

I got an linking error when compiling "PAppStdPlugin" (VS.Net 2003 and OCC5):

Creating library Debug/PAppStdPlugin.lib and object Debug/PAppStdPlugin.exp LIBCD.lib(wwincrt0.obj) : error LNK2001: unresolved external symbol _wWinMain@16 Debug/PAppStdPlugin.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
For the debug and and the release version.

Any hints?

Best regards,

Patrik

Patrik Mueller's picture

Ok,

this works now - it was a wrong setting in the OCC projects.
But now I've got linker problems when I try to build classes with handles like explained in "http://www.opencascade.com/faq/nocdlhandle.htm":

Im_StripifierACTC.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierNvidia.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierTri_Stripper.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Vertex.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MaterialTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Mesh.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MeshTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Stripifier.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Edge.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Face.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_HalfEdge.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Material.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Transient@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierACTC.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierNvidia.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierTri_Stripper.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Vertex.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MaterialTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Mesh.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MeshTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Stripifier.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Edge.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Face.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_HalfEdge.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Material.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: virtual void __thiscall Standard_Storable::ShallowDump(class std::basic_ostream > &)const " (?ShallowDump@Standard_Storable@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierACTC.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierNvidia.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_StripifierTri_Stripper.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Vertex.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MaterialTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Mesh.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_MeshTool.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Stripifier.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Edge.obj : error LNK2019: Nicht aufgel”stes externes Symbol '"public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)', verwiesen in Funktion '"public: void __thiscall Standard_Type::operator<<(class std::basic_ostream > &)const " (??6Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)'
Im_Face.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_HalfEdge.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Im_Material.obj : error LNK2001: Nichtaufgel”stes externes Symbol "public: void __thiscall Standard_Type::Print(class std::basic_ostream > &)const " (?Print@Standard_Type@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)

It seems it misses Print and ShallowDump in different classes. Which files do I have to include?

Regards,

Patrik

Conrad J Poelman's picture

Hi Patrick,

Yes, it looks like you're missing exactly three functions that should be defined in the Open CASCADE 5.0 library. My first guess is that you're linking against the wrong version of the compiled Open CASADE 5.0 library, so your code is looking for the new versions of the functions that take std::ostream, but your libraries still have the old, non-std versions.

One way to check is to run Visual Studio's "Dependency Walker" program (Depends.exe) on TKERNEL.DLL file. On mine, I can scroll down to find that the symbol "?Print@Standard_Type@@..." is indeed defined in that DLL, down to the exact letters of the name mangling - especially including the "@std@@@std@@@Z" part at the end which shows that it's in the std:: namespace.

One thing I may have failed to point out is that the default Open CASCADE visual studio project files and solutions put the resulting Open CASCADE LIB and DLL files into ros/adm/win32/{Debug,Release}. So perhaps you're just still linking against the old versions in ros/win32/{lib,libd,dll,dlld}, that probably came with Open CASCADE installation and were compiled with an older version of visual studio? In my case I had to manually copy the .libs and .dlls into the ros/win32 file. Alternatively you could adjust your include path and link path to include the rows/adm/win32 directories.

Good luck, let me know if this helps or not!

-- Conrad

Patrik Mueller's picture

Hi Conrad,

I can't reproduce where my error was, but after recompiling everything works.
Perhaps it was an error in my IDE....

Thanks for your help (and the nice tool)!!!!

Regards,

Patrik