OCC 5.2 linking problem with Visual C++ 7.1

hi everybody!

trying to link OCC52 to my program with Visual C++ 7.1 i get linker errors like this one:

error LNK2019: unresolved external symbol "void * * theFreeList" (?theFreeList@@3PAPAXA) referenced in function "public: static void __cdecl Standard::Free(void * &)" (?Free@Standard@@SAXAAPAX@Z)

when i rebuild TKernel module i get warnings like this:

NCollection_BaseVector.obj : warning LNK4049: locally defined symbol ?theFreeList@@3PAPAXA (void * * theFreeList) imported
NCollection_IncAllocator.obj : warning LNK4217: locally defined symbol ?theFreeList@@3PAPAXA (void * * theFreeList) imported in function "public: static void * __cdecl Standard::Allocate(int)" (?Allocate@Standard@@SAPAXH@Z)

does anyone know a solution to my problem?

thx a lot,
robert

Patrik Mueller's picture

Hi Robert,

have you checked your project settings? I can use it without such a problem.

Greets,

Patrik

robert_gaisbauer's picture

Thanks Patrik, but everything seems ok there. Can you rebuild TKernel.lib with the warnings (say from FoundationClasses.sln)?

greets,
robert

Francois Lauzon's picture

Hello Robert,
I've got the warnings when I rebuild the TKernel module, but I don't get the error when I linked OCC52 with my application. If you could reproduce you problem with a small application, maybe you could send it to me an I will try to rebuild it.
Good Luck,
Francois.

robert_gaisbauer's picture

Hi to all!

Thank you for your help. I just discovered my mistake. I didn't have the define WNT in my project settings. now i can link ...

thank you,
robert

Xiu's picture

Hi, Robert,

I have similar problem when I tried to compile the 07_Viewer3D Sample project provided by OpenCASCADE under C:\OpenCASCADE5.2\samples\standard\Mfc. I have got the following 5 link errors of the same type.

Should be grateful if you could let me know how you resolve this.

Many thanks

Xiu

Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)
Viewer3dDoc.obj Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)

Xiu's picture

Hi, Robert,

I have similar problem when I tried to compile the 07_Viewer3D Sample project provided by OpenCASCADE under C:\OpenCASCADE5.2\samples\standard\Mfc. I have got the following 5 link errors of the same type.

Should be grateful if you could let me know how you resolve this.

Many thanks

Xiu

Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)
Viewer3dDoc.obj Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)

Xiu's picture

Hi, Robert,

I have similar problem when I tried to compile the 07_Viewer3D Sample project provided by OpenCASCADE under C:\OpenCASCADE5.2\samples\standard\Mfc. I have got the following 5 link errors of the same type.

Should be grateful if you could let me know how you resolve this.

Many thanks

Xiu

Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)
Viewer3dDoc.obj Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)

Xiu's picture

Hi, Robert,

I have similar problem when I tried to compile the 07_Viewer3D Sample project provided by OpenCASCADE under C:\OpenCASCADE5.2\samples\standard\Mfc. I have got the following 5 link errors of the same type.

Should be grateful if you could let me know how you resolve this.

Many thanks

Xiu

Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)
Viewer3dDoc.obj Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)

Xiu's picture

Hi, Robert,

I have similar problem when I tried to compile the 07_Viewer3D Sample project provided by OpenCASCADE under C:\OpenCASCADE5.2\samples\standard\Mfc. I have got the following 5 link errors of the same type.

Should be grateful if you could let me know how you resolve this.

Many thanks

Xiu

Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)
Viewer3dDoc.obj Viewer3dApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) Creferenced in function "public: virtual int __thiscall CViewer3dApp::InitInstance(void)" (?InitInstance@CViewer3dApp@@UAEHXZ)

ngoctn's picture

Please check your environment variable for Visual C++ (Setting up in VC+ option, With VC++7, select Options from Tools menu, then go to Projects/VC ++ Directories item)

Xiu's picture

Hi,

I have set the pathname to bin and lib of opencascade. I still got the above problem. Any more suggestions will be welcome.

Best regards,

Xiu