Problem Compiling BBAI Source Files

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
I am attempting to make a new DLL starting with the source files from BBAI and I get this error:

Code:
1>CvPlayerAI.obj : error LNK2019: unresolved external symbol "void __cdecl logBBAI(char *,...)" (?logBBAI@@YAXPADZZ) referenced in function "public: virtual void __thiscall CvPlayerAI::AI_conquerCity(class CvCity *)" (?AI_conquerCity@CvPlayerAI@@UAEXPAVCvCity@@@Z)
1>Final_Release\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003/bin/link.exe"' : return code '0x460'
1>Stop.
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"

What change do I need to make to the CvPlayerAI.cpp file?

Do I need to add something to my Makefile?

Please be specific, as my SDK skills are limited.
 
In addition to the problem with CvPlayerAI, there are a couple of files that appear to be new and I'm certain the problem is related to these files:

BetterBTSAI.cpp
BetterBTSAI.h

My Makefile works fine, when compiling the standard BTS files, but fails when I overwrite some of them with the changed files from BBAI. This can't be a new problem as BBAI has been out for a long time. :help:
 
The problem is that BetterBTSAI.cpp is not linked with the other sources, and probably not even compiled.
I'm guessing it's because you're using an old makefile which has a list of source files, and this file is just not there.
Take a look at your make file and see if the source files (*.cpp) are listed there.

If so, you can either switch to a newer makefile or add the following where appropriate:
(These are similar to the ones in the old makefile I know. If yours is different you might need to make some changes)

Code:
Debug/BetterBTSAI.obj: BetterBTSAI.cpp
	$(Debug_CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /c BetterBTSAI.cpp /FoDebug/BetterBTSAI.obj

Code:
Final_Release/BetterBTSAI.obj: BetterBTSAI.cpp
	$(Final_Release_CPP) /nologo $(Final_Release_CFLAGS) $(Final_Release_INCS) /c BetterBTSAI.cpp /FoFinal_Release/BetterBTSAI.obj

To Debug_OBJS you need to add:
Code:
... Debug\BetterBTSAI.obj ...

To Final_Release_OBJS you need to add:
Code:
... Final_Release\BetterBTSAI.obj ...

I hope I didn't miss anything.
 
The problem is that BetterBTSAI.cpp is not linked with the other sources, and probably not even compiled.
I'm guessing it's because you're using an old makefile which has a list of source files, and this file is just not there.
Take a look at your make file and see if the source files (*.cpp) are listed there.

If so, you can either switch to a newer makefile or add the following where appropriate:
(These are similar to the ones in the old makefile I know. If yours is different you might need to make some changes)

Code:
Debug/BetterBTSAI.obj: BetterBTSAI.cpp
	$(Debug_CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /c BetterBTSAI.cpp /FoDebug/BetterBTSAI.obj

Code:
Final_Release/BetterBTSAI.obj: BetterBTSAI.cpp
	$(Final_Release_CPP) /nologo $(Final_Release_CFLAGS) $(Final_Release_INCS) /c BetterBTSAI.cpp /FoFinal_Release/BetterBTSAI.obj

To Debug_OBJS you need to add:
Code:
... Debug\BetterBTSAI.obj ...

To Final_Release_OBJS you need to add:
Code:
... Final_Release\BetterBTSAI.obj ...

I hope I didn't miss anything.

That was it! The DLL compiled and tested OK.


:thanx:
 
Back
Top Bottom