HELP : Ceating MFC DLL

Dear all,
I am working with OCC 6.9 and vc2010. I included all needed paths for dlls, libs and inc files and then all mfc samples are working fine. when I add a new project to my solution to make a dll for visual basic the following errors appears by adding just #include "gp_Pnt.hxx" to the project. I know it may be related to libs but I included every thing like what I did for sample files as bellow. Could somebody please help?

Preprocessor definition:
NDEBUG;WIN64;_WINDOWS;WNT;WINVER=0x0500;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)

DLL:
C:\OpenCASCADE6.9.0\freeimage-3.16.0-vc10-32\bin;C:\OpenCASCADE6.9.0\freetype-2.5.3-vc10-32\bin;C:\OpenCASCADE6.9.0\gl2ps-1.3.8-vc10-32\bin;C:\OpenCASCADE6.9.0\qt486-vc10-32\bin;C:\OpenCASCADE6.9.0\tbb30_018oss\bin;C:\OpenCASCADE6.9.0\tcltk-86-32\bin;C:\OpenCASCADE6.9.0\VTK-6.1.0-vc10-32\bin;C:\OpenCASCADE6.9.0\opencascade-6.9.0\win64\vc10\bin;$(ExecutablePath)

Inc:
C:\OpenCASCADE6.9.0\opencascade-6.9.0\inc;$(IncludePath)

Lib:
C:\OpenCASCADE6.9.0\freeimage-3.16.0-vc10-32\lib;C:\OpenCASCADE6.9.0\freetype-2.5.3-vc10-32\lib;C:\OpenCASCADE6.9.0\gl2ps-1.3.8-vc10-32\lib;C:\OpenCASCADE6.9.0\qt486-vc10-32\lib;C:\OpenCASCADE6.9.0\tbb30_018oss\lib;C:\OpenCASCADE6.9.0\tcltk-86-32\lib;C:\OpenCASCADE6.9.0\VTK-6.1.0-vc10-32\lib;C:\OpenCASCADE6.9.0\opencascade-6.9.0\win64\vc10\lib;$(LibraryPath)

Additional Dependencise:
TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;TKBO.lib;%(AdditionalDependencies)

ERRORS:
Error 1 error LNK2001: unresolved external symbol "public: static void __cdecl Standard::Free(void * const)" (?Free@Standard@@SAXQAX@Z) C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\MyNURBS_DLL\MyNURBS_DLL.obj MyNURBS_DLL
Error 2 error LNK2001: unresolved external symbol "public: virtual void __thiscall Standard_Storable::Delete(void)" (?Delete@Standard_Storable@@UAEXXZ) C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\MyNURBS_DLL\MyNURBS_DLL.obj MyNURBS_DLL
Error 3 error LNK2001: unresolved external symbol "public: virtual int __thiscall Standard_Storable::HashCode(int)const " (?HashCode@Standard_Storable@@UBEHH@Z) C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\MyNURBS_DLL\MyNURBS_DLL.obj MyNURBS_DLL
Error 4 error LNK2001: unresolved external 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) C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\MyNURBS_DLL\MyNURBS_DLL.obj MyNURBS_DLL
Error 5 error LNK2001: unresolved external symbol "public: static void __cdecl Standard_OutOfRange::Raise(char const * const)" (?Raise@Standard_OutOfRange@@SAXQBD@Z) C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\MyNURBS_DLL\MyNURBS_DLL.obj MyNURBS_DLL
Error 6 error LNK1120: 5 unresolved externals C:\OpenCASCADE6.9.0\opencascade-6.9.0\samples\mfc\standard\Release\MyNURBS_DLL.dll MyNURBS_DLL

Shing Liu's picture

Hi A.Akbari,

From your Preprocessor definition:
NDEBUG;WIN64;_WINDOWS;WNT;WINVER=0x0500;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)

I found you use the WIN64 to compile occ, while your 3rd party libaries are for 32bit, so this maybe the problem.

Change all of them to WIN32 or WIN64, including your MFC DLL.

Best Regards,
Shing Liu

akbari1358_31365's picture

Thank you Shing Liu,
I changed all 3rd party to win64 but no success

Shing Liu's picture

How about your MFC DLL?
Do you change it to WIN64?

akbari1358_31365's picture

yes I checked it is win64.
I create another win32 console application and select dll type of application then I add a simple function. It works but the problem is that when I want to use it in vba (win64 office x86) run-time error 48 "file not found" appears! I checked and changed the location of file and declaration in vb many times but no success.