Linker error building c# sample

Hello,

I've compiled successfully OpenCascade 6.5.2 under windows 7. As I don't have MFC, I'm trying to compile the C# sample, but I'm getting twelve linker errors. At the beginning it couldn't find some of the required .libs but now the problem seems to be it can't find the location of functions on its own files. Any help is much appreciated!

Cheers,
Bernardo

Error 910 error LNK2028: unresolved token (0A000066) "class Handle_Standard_Type & __cdecl ShapeSchema_Type_(void)" (?ShapeSchema_Type_@@$$FYAAAVHandle_Standard_Type@@XZ) referenced in function "public: virtual class Handle_Standard_Type const & __thiscall ShapeSchema::DynamicType(void)const " (?DynamicType@ShapeSchema@@$$FUBEABVHandle_Standard_Type@@XZ) OCCViewer.obj

Error 911 error LNK2028: unresolved token (0A000072) "public: unsigned int __thiscall V3d_View::Dump(char const * const)" (?Dump@V3d_View@@$$FQAEIQBD@Z) referenced in function "public: bool __thiscall OCCViewer::Dump(char *)" (?Dump@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 912 error LNK2028: unresolved token (0A00008F) "public: static class Handle_AIS_Shape const __cdecl Handle_AIS_Shape::DownCast(class Handle_Standard_Transient const &)" (?DownCast@Handle_AIS_Shape@@$$FSA?BV1@ABVHandle_Standard_Transient@@@Z) referenced in function "public: bool __thiscall OCCViewer::ExportBRep(char *)" (?ExportBRep@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 913 error LNK2028: unresolved token (0A000177) "public: static class Handle_PTopoDS_HShape const __cdecl Handle_PTopoDS_HShape::DownCast(class Handle_Standard_Persistent const &)" (?DownCast@Handle_PTopoDS_HShape@@$$FSA?BV1@ABVHandle_Standard_Persistent@@@Z) referenced in function "public: bool __thiscall OCCViewer::ImportCsfdb(char *)" (?ImportCsfdb@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 914 error LNK2028: unresolved token (0A0001D2) "public: __thiscall BRep_Builder::BRep_Builder(void)" (??0BRep_Builder@@$$FQAE@XZ) referenced in function "public: bool __thiscall OCCViewer::ImportBRep(char *)" (?ImportBRep@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 915 error LNK2019: unresolved external symbol "public: unsigned int __thiscall V3d_View::Dump(char const * const)" (?Dump@V3d_View@@$$FQAEIQBD@Z) referenced in function "public: bool __thiscall OCCViewer::Dump(char *)" (?Dump@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 916 error LNK2019: unresolved external symbol "public: __thiscall BRep_Builder::BRep_Builder(void)" (??0BRep_Builder@@$$FQAE@XZ) referenced in function "public: bool __thiscall OCCViewer::ImportBRep(char *)" (?ImportBRep@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 917 error LNK2019: unresolved external symbol "public: static class Handle_AIS_Shape const __cdecl Handle_AIS_Shape::DownCast(class Handle_Standard_Transient const &)" (?DownCast@Handle_AIS_Shape@@$$FSA?BV1@ABVHandle_Standard_Transient@@@Z) referenced in function "public: bool __thiscall OCCViewer::ExportBRep(char *)" (?ExportBRep@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 918 error LNK2019: unresolved external symbol "class Handle_Standard_Type & __cdecl ShapeSchema_Type_(void)" (?ShapeSchema_Type_@@$$FYAAAVHandle_Standard_Type@@XZ) referenced in function "public: virtual class Handle_Standard_Type const & __thiscall ShapeSchema::DynamicType(void)const " (?DynamicType@ShapeSchema@@$$FUBEABVHandle_Standard_Type@@XZ) OCCViewer.obj

Error 919 error LNK2019: unresolved external symbol "public: static class Handle_PTopoDS_HShape const __cdecl Handle_PTopoDS_HShape::DownCast(class Handle_Standard_Persistent const &)" (?DownCast@Handle_PTopoDS_HShape@@$$FSA?BV1@ABVHandle_Standard_Persistent@@@Z) referenced in function "public: bool __thiscall OCCViewer::ImportCsfdb(char *)" (?ImportCsfdb@OCCViewer@@$$FQAE_NPAD@Z) OCCViewer.obj

Error 920 error LNK2019: unresolved external symbol __imp__GetEnv referenced in function "private: void __thiscall Graphic3d_WNTGraphicDevice::SetGraphicDriver(void)" (?SetGraphicDriver@Graphic3d_WNTGraphicDevice@@AAEXXZ) TKV3d.lib

Error 921 fatal error LNK1120: 11 unresolved externals Debug/OCC.dll

Forum supervisor's picture

Dear Bernardo,
By default the script Run_MSVC.bat (dedicated to compile the sample) builds it for vc8.
Take it, please into account and tune it according your environment. Besides I suggest
you to check validity of the path to OCCT libs in the Visual Studio project.
Regards