Can't compile AISBasic


I am trying to compile 04_AISBasic on Microsoft Visual C++ 7.1 (.NET 2003) and it will not work.

The first problem I had was that nearly 50 symbols were missing. Since OCC is by far the biggest application I've ever seen, I had absolutely no idea which libraries to include. So I loaded all the libraries into a hex editor and used to the "search" function to look through the symbol tables to find the missing ones (I don't have a fancy tool for reading export tables. Can someone recommend one?)

However, there are 3 symbols still missing:

1.) unresolved external symbol "__declspec(dllimport) public: virtual __thiscall OCC_3dDoc::~OCC_3dDoc(void)" (__imp_??1OCC_3dDoc@@UAE@XZ) referenced in function __unwindfunclet$??0CAISBasicDoc@@QAE@XZ$0

2.) unresolved external symbol "__declspec(dllimport) public: __thiscall OCC_3dDoc::OCC_3dDoc(void)" (__imp_??0OCC_3dDoc@@QAE@XZ) referenced in function "public: __thiscall CAISBasicDoc::CAISBasicDoc(void)" (??0CAISBasicDoc@@QAE@XZ)

3.) unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall OCC_3dChildFrame::GetThisClass(void)" (__imp_?GetThisClass@OCC_3dChildFrame@@SGPAUCRuntimeClass@@XZ) referenced in function "public: virtual int __thiscall CAISBasicApp::InitInstance(void)" (?InitInstance@CAISBasicApp@@UAEHXZ)

Now interestingly, most of symbols in the OCC_3dDoc namespace are found in mfcsample.lib and including it made most of the OCC_3dDo errors go away! Except for these three. So I guess they're not in there? I've basically checked every single library file there is and it won't satisfy the linker.

Ken Camann

CloneX's picture

I use a freeware tool called DLL Export Viewer to list all exported functions in a DLL:

I have been able to build 04_AISBasic in VC++ 6.0 but haven't tried it in 7.1. You definitely need to link in mfcsample.lib since it contains lots of common code used by all the MFC samples.


kjcamann's picture

If anyone else has this problem I should note that it comes from using MFCSample as developed in Visual C++ 6.0 MFC with Visual C++ 7.1. They changed MFC and it is not compatible with old versions, the dynamic class runtime stuff was all changed, thus the missing symbols relating to CRuntimeClass. Unforunately if you're a new user searching for an answer and find this, I don't have a solution: I fought with updating it for a long time and gave up, since I wanted to move to wxWidgets anyway (have to run on Linux too).