• Civilization 7 has been announced. For more info please check the forum here .

Having Troubles Compiling

TheLadiesOgre

Aspiring Codesmith
Joined
Jan 16, 2009
Messages
505
Hey, I want to use Better BUG AI as a base on which to build a mod, I'm also trying to use DannyDaemonic's Makefile. I keep getting 23 unresolved externals related to CxImage

Here they are specifically

Spoiler :
Code:
1> "C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\bin\link.exe" /out:Release\CvGameCoreDLL.dll /INCREMENTAL:NO /OPT:REF /OPT:ICF /PDB:"Release\CvGameCoreDLL.pdb" /DLL /NOLOGO /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1 /LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib /LIBPATH:"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0A/Lib" winmm.lib user32.lib Release\BetterBTSAI.obj  Release\CvArea.obj  Release\CvArtFileMgr.obj  Release\CvBugOptions.obj  Release\CvCity.obj  Release\CvCityAI.obj  Release\CvDeal.obj  Release\CvDiploParameters.obj  Release\CvDLLButtonPopup.obj  Release\CvDLLEntity.obj  Release\CvDLLPython.obj  Release\CvDllPythonEvents.obj  Release\CvDllTranslator.obj  Release\CvDLLWidgetData.obj  Release\CvEventReporter.obj  Release\CvFractal.obj  Release\CvGame.obj  Release\CvGameAI.obj  Release\CvGameCoreDLL.obj  Release\CvGameCoreUtils.obj  Release\CvGameInterface.obj  Release\CvGameTextMgr.obj  Release\CvGlobals.obj  Release\CvHallOfFameInfo.obj  Release\CvInfos.obj  Release\CvInfoWater.obj  Release\CvInitCore.obj  Release\CvMap.obj  Release\CvMapGenerator.obj  Release\CvMessageControl.obj  Release\CvMessageData.obj  Release\CvPlayer.obj  Release\CvPlayerAI.obj  Release\CvPlot.obj  Release\CvPlotGroup.obj  Release\CvPopupInfo.obj  Release\CvPopupReturn.obj  Release\CvRandom.obj  Release\CvReplayInfo.obj  Release\CvReplayMessage.obj  Release\CvSelectionGroup.obj  Release\CvSelectionGroupAI.obj  Release\CvStatistics.obj  Release\CvStructs.obj  Release\CvTalkingHeadMessage.obj  Release\CvTeam.obj  Release\CvTeamAI.obj  Release\CvTextScreens.obj  Release\CvUnit.obj  Release\CvUnitAI.obj  Release\CvXMLLoadUtility.obj  Release\CvXMLLoadUtilityGet.obj  Release\CvXMLLoadUtilityInit.obj  Release\CvXMLLoadUtilitySet.obj  Release\CyArea.obj  Release\CyAreaInterface.obj  Release\CyArgsList.obj  Release\CyArtFileMgr.obj  Release\CyArtFileMgrInterface.obj  Release\CyCity.obj  Release\CyCityInterface1.obj  Release\CyDeal.obj  Release\CyEnumsInterface.obj  Release\CyGame.obj  Release\CyGameCoreUtils.obj  Release\CyGameCoreUtilsInterface.obj  Release\CyGameInterface.obj  Release\CyGameTextMgr.obj  Release\CyGameTextMgrInterface.obj  Release\CyGlobalContext.obj  Release\CyGlobalContextInterface1.obj  Release\CyGlobalContextInterface2.obj  Release\CyGlobalContextInterface3.obj  Release\CyGlobalContextInterface4.obj  Release\CyHallOfFameInfo.obj  Release\CyHallOfFameInterface.obj  Release\CyInfoInterface1.obj  Release\CyInfoInterface2.obj  Release\CyInfoInterface3.obj  Release\CyMap.obj  Release\CyMapGenerator.obj  Release\CyMapGeneratorInterface.obj  Release\CyMapInterface.obj  Release\CyMessageControl.obj  Release\CyMessageControlInterface.obj  Release\CyPlayer.obj  Release\CyPlayerInterface1.obj  Release\CyPlayerInterface2.obj  Release\CyPlot.obj  Release\CyPlotInterface1.obj  Release\CyRandomInterface.obj  Release\CyReplayInfo.obj  Release\CySelectionGroup.obj  Release\CySelectionGroupInterface.obj  Release\CyStructsInterface1.obj  Release\CyTeam.obj  Release\CyTeamInterface.obj  Release\CyUnit.obj  Release\CyUnitInterface1.obj  Release\FAssert.obj  Release\FDialogTemplate.obj  Release\_precompile.obj   Release\CvGameCoreDLL.res
1>   Creating library Release\CvGameCoreDLL.lib and object Release\CvGameCoreDLL.exp
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CxMemFile::GetC(void)" (?GetC@CxMemFile@@UAEJXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CxMemFile::PutC(unsigned char)" (?PutC@CxMemFile@@UAE_NE@Z)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CxMemFile::Error(void)" (?Error@CxMemFile@@UAEJXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CxMemFile::Eof(void)" (?Eof@CxMemFile@@UAE_NXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CxMemFile::Flush(void)" (?Flush@CxMemFile@@UAE_NXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CxMemFile::Size(void)" (?Size@CxMemFile@@UAEJXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CxMemFile::Tell(void)" (?Tell@CxMemFile@@UAEJXZ)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CxMemFile::Seek(long,int)" (?Seek@CxMemFile@@UAE_NJH@Z)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CxMemFile::Write(void const *,unsigned int,unsigned int)" (?Write@CxMemFile@@UAEIPBXII@Z)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CxMemFile::Read(void *,unsigned int,unsigned int)" (?Read@CxMemFile@@UAEIPAXII@Z)
1>CvGame.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CxMemFile::Close(void)" (?Close@CxMemFile@@UAE_NXZ)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: __thiscall CxMemFile::CxMemFile(unsigned char *,unsigned long)" (??0CxMemFile@@QAE@PAEK@Z) referenced in function "public: void __thiscall CxMemFile::`default constructor closure'(void)" (??_FCxMemFile@@QAEXXZ)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CxMemFile::~CxMemFile(void)" (??1CxMemFile@@UAE@XZ) referenced in function "public: virtual void * __thiscall CxMemFile::`scalar deleting destructor'(unsigned int)" (??_GCxMemFile@@UAEPAXI@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CxImage::Destroy(void)" (?Destroy@CxImage@@QAE_NXZ) referenced in function "public: virtual __thiscall CxImage::~CxImage(void)" (??1CxImage@@UAE@XZ)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: __thiscall CxImage::CxImage(unsigned long)" (??0CxImage@@QAE@K@Z) referenced in function "public: void __thiscall CxImage::`default constructor closure'(void)" (??_FCxImage@@QAEXXZ)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: __thiscall CxImage::CxImage(class CxImage const &,bool,bool,bool)" (??0CxImage@@QAE@ABV0@_N11@Z) referenced in function "public: void __thiscall CxImage::`copy constructor closure'(class CxImage const &)" (??_OCxImage@@QAEXABV0@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CxImage::Save(char const *,unsigned long)" (?Save@CxImage@@QAE_NPBDK@Z) referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CxImage::CreateFromHBITMAP(struct HBITMAP__ *,struct HPALETTE__ *)" (?CreateFromHBITMAP@CxImage@@QAE_NPAUHBITMAP__@@PAUHPALETTE__@@@Z) referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol __imp__BitBlt@36 referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol __imp__CreateCompatibleBitmap@12 referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>CvGame.obj : error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function "public: bool __thiscall CvGame::takeJPEGScreenShot(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?takeJPEGScreenShot@CvGame@@QBE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Release\CvGameCoreDLL.dll : fatal error LNK1120: 23 unresolved externals
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\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"

I didn't want to highjack his thread, I've been over his thread with a fine-tooth comb and nothing I've tried works. Does anyone have any help, recommendations, suggestions or thoughts?
 
A lot of people, myself included, find cximage to be too much trouble. It is used in some special routine to take screenshots. If you look for places directly within the cvgamecore cpp files to see where cximage is called, you will find only one or two places. I simply deleted these few lines, so that the special routine was no longer present. Then everything compiles without cximage fine.
 
thanks for the assist davidallen, worked like a charm, seems to have no ill side-effects either (at least with the little play-testing I've been able to do so far)
 
I'm complete compiling noob. When I follow the guide (http://modiki.civfanatics.com/index.php/How_to_Install_the_SDK) and try to Build Solution I get an error (see attachment). I use Visual Studio 2008 and this Makefile: http://forums.civfanatics.com/showthread.php?t=370861 (used previously a makefile from tutorial, but got an error as well).

What did I wrong? Maybe some ill files placement (I'm unable to do "Click -Project- -Add Existing Item…-. The "Add Existing Item – CvGameCoreDLL" window will open. This folder will contain all of the source code files, the Boost-1.32.0 folder, and the Python24 folder. Select everything (use Ctrl-A) and click -Add-. You only want to add: all *.h files, all (2) *.inl files, all *.cpp files and the both subfolders. If you followed the instructions so far (i.e. deleted all unneeded files) CTRL+A will give you exactly this. If you – for whatever reason – kept some of the unneeded files, you need to deselect them manually." with Ctrl+A because I have Makefile, readme and CvGameCoreDLL [.vcproject, etc.] there)? Thanks in advance :)
 

Attachments

  • Error.txt
    95 KB · Views: 77
Alrighty, so I screwed up the working copy of what I had working and rage-deleted it without a backup. Now I haven't been able to get a working Better BUG AI to compile at all. Not with the BUG makefile that EF made, not with DannyDaemonic's, the twice that I've been able to get it to compile, it CTD as soon as the mod is loaded. When I've tried to run it, I've had all of the Better BUG AI Assets\ folders as the sole files in the folder (with nothing that isn't a Better BUG AI Asset in the folder). I'm getting extremely frustrated and have come close to pitching my desktop (monitor and all) out the window.

\end rant

Please Help save my computer from a violent death...
 
Try compiling vanilla. Even if it seems trivial a small success will reduce rage. If you spot something different, then retry bbai.
 
Alright, I have been able to actually get pure vanilla Civ4 BTS 3.19 to compile as well as compiling and successfully running Better AI 1.01. Thanks for the idea

I've noticed that when I compile Better BUG AI it compiles the files from CxImage along with the files from the SDK, is this something that should be happening?
 
The presence of the files isn't enough to make them compile because they are in a separate subfolder. When I tried to make Danny's makefile work, I had to add special rules and modify the pat that created a list of all source folders before it would compile any of the CxImage files. Unless Fuyu moved the files to the main SDK folder or added rules to the makefile, they should not compile.

Are you for sure using the makefile and not having VS do the compilation itself?
 
Well, the CxImage files are in their seperate subfolders (CxImage\general and CxImage\jpeg), I'll look at the makefiles with WinMerge to see if anything jumps out at me.

As far as having VS do the compiling, I don't think that is what is happening, I set everything up as usual, jumping through all of the "Project Properties" hoops that I've had to since the first DLL-mod I did. :confused:
 
I thought Fuyu removed CxImage from Better BUG AI.
No I did not. Only everyone else who tries to compile it does that :p
I added the files to the project, so it's definitely getting compiled if you use VS 2003, not sure about the Makefile though. I believe it's still the old BULL one though so it should contain the rules for CxImage.
Of course, if people are using different makefiles then they will experience the problems seen in the first post, but that really shouldn't be surprisign for anyone ..
 
Top Bottom