CxImage Static Library FTW

EmperorFool

Deity
Joined
Mar 2, 2007
Messages
9,633
Location
Mountain View, California
After much hair pulling I think I may have a working static library (.lib) for CxImage that you can link to when compiling a BULL-based SDK. I have attached a debug and release version, and you need to link to each appropriately in your makefile. I have tried it once using Refar's makefile, and it seems to work. I haven't had time to exhaustively test it yet, but if it does work it'll be in the imminent BULL release.

1. Remove the CxImage folder from your SDK folder if you still have it.

2. Add the attached header files to your SDK folder. [In my test I created a CxImage subfolder under SDK to hold the header files and added that folder as a /I option in the makefile. But you don't have to do all that if you put them in the root SDK folder with the other .h files.]

3. Add the attached libraries to the link targets in your makefile, one for each type of build.

Now, compiling the .cpp and .c files was never an issue I don't think, so this may not even solve the problems people have been having. However, using a static library should hopefully narrow the issue down so I can solve it. That would be :goodjob:
 
Ok, so I made a test project in VS2008 Express, I was trying to build Better BUG AI using DannyDaemonic's Makefile amended thusly: (changes are bolded)

Spoiler :
Code:
#### Civilization 4 SDK Makefile 1.0 ####
####  Copyright 2010 Danny Daemonic  ####
#########################################

#### Paths ####
TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
PSDK=C:\Program Files\Microsoft SDKs\Windows\v6.0A
## Uncomment to have newly compiled dlls copied to your mod's Assets directory
#YOURMOD=C:\Users\Danny\Documents\My Games\beyond the sword\MODS\MyMod

#### Tools ####
CC="$(TOOLKIT)\bin\cl.exe"
CPP="$(TOOLKIT)\bin\cl.exe"
LD="$(TOOLKIT)\bin\link.exe"
RC="$(PSDK)\bin\rc.exe"
## Uncomment to build dependencies using fastdep
FD="$(TOOLKIT)\bin\fastdep.exe"

#### BLACKLIST ####
## Uncomment to block CvTextScreen (accidentally included by Firaxis)
BLACKLIST=CvTextScreens

#### You shouldn't need to modify anything beyond this point ####
#################################################################

#### Target Files ####
Debug_BIN=Debug\CvGameCoreDLL.dll
Release_BIN=Release\CvGameCoreDLL.dll

!IF [IF NOT EXIST CvGameCoreDLL.rc EXIT 1] == 0
Debug_RESOURCE=Debug\CvGameCoreDLL.res
Release_RESOURCE=Release\CvGameCoreDLL.res
!ENDIF

Debug_STATICLIB=Debug\CvGameCoreDLL.lib
Release_STATICLIB=Release\CvGameCoreDLL.lib

Debug_LIBDEF=Debug\CvGameCoreDLL.def
Release_LIBDEF=Release\CvGameCoreDLL.def

Debug_PCH=Debug\CvGameCoreDLL.pch
Release_PCH=Release\CvGameCoreDLL.pch

Debug_PDB=Debug\CvGameCoreDLL.pdb
Release_PDB=Release\CvGameCoreDLL.pdb

Debug_OTHER=Debug\CvGameCoreDLL.exp Debug\CvGameCoreDLL.ilk
Release_OTHER=Release\CvGameCoreDLL.exp

#### CFLAGS ####
GLOBAL_CFLAGS=/GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS [COLOR="Red"][B]/DLOG_AI /D_MOD_FRACTRADE /D_MOD_SENTRY /D_MOD_GOVWORKERS /D_MOD_GWARM[/B][/COLOR] /Yu"CvGameCoreDLL.h"
Debug_CFLAGS=/MD /Zi /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS)
Release_CFLAGS=/MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"$(Release_PCH)" $(GLOBAL_CFLAGS)

#### LDFLAGS ####
GLOBAL_LDFLAGS=/DLL /NOLOGO /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1
Debug_LDFLAGS=/INCREMENTAL /DEBUG /PDB:"$(Debug_PDB)" /IMPLIB:"$(Debug_STATICLIB)" $(GLOBAL_LDFLAGS)
Release_LDFLAGS=/INCREMENTAL:NO /OPT:REF /OPT:ICF /PDB:"$(Release_PDB)" $(GLOBAL_LDFLAGS)

#### INCLUDES ####
GLOBAL_INCS=/I"$(TOOLKIT)/include" /I"$(PSDK)/Include" /I"$(PSDK)/Include/mfc"
PROJECT_INCS=/IBoost-1.32.0/include /IPython24/include
Debug_INCS=$(PROJECT_INCS) $(GLOBAL_INCS)
Release_INCS=$(PROJECT_INCS) $(GLOBAL_INCS)

#### LIBS ####
GLOBAL_LIBS=/LIBPATH:"$(TOOLKIT)/lib" /LIBPATH:"$(PSDK)/Lib" winmm.lib user32.lib
PROJECT_LIBS=/LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib
Debug_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS) msvcprt.lib [COLOR="red"][B]CxImage_debug.lib[/B][/COLOR]
Release_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS) [COLOR="red"][B]CxImage.lib[/B][/COLOR]

#### Objects ####
Debug_LINKOBJS=$(Debug_OBJS)
Release_LINKOBJS=$(Release_OBJS)

#### Auto SOURCES/OBJS ####
!IF [ECHO SOURCES= \> sources.mk] == 0 && \
    [FOR %i IN (*.cpp) DO @ECHO. "%i" \>> sources.mk] == 0 && \
    [ECHO.>> sources.mk] == 0 && \
    [ECHO Debug_OBJS= \>> sources.mk] == 0 && \
    [FOR /F "delims=." %i IN ('dir /b *.cpp') DO @ECHO. Debug\%i.obj \>> sources.mk] == 0 && \
    [ECHO.>> sources.mk] == 0 && \
    [ECHO Release_OBJS= \>> sources.mk] == 0 && \
    [FOR /F "delims=." %i IN ('dir /b *.cpp') DO @ECHO. Release\%i.obj \>> sources.mk] == 0 && \
    [ECHO.>> sources.mk] == 0
!INCLUDE sources.mk
!IF [DEL sources.mk]
!ENDIF
!ENDIF

#### Targets ####
#################

.PHONY: all clean Debug_clean Release_clean Debug Release

all: Debug Release

clean: Debug_clean Release_clean 

Debug_clean:
	@FOR %i IN ($(Debug_BIN) $(Debug_STATICLIB) $(Debug_LIBDEF) \
		Debug\*.obj Debug\*.@ $(Debug_RESOURCE) \
		$(Debug_PCH) $(Debug_PDB) $(Debug_OTHER)) DO @IF EXIST "%i" DEL "%i"

Release_clean:
	@FOR %i IN ($(Release_BIN) $(Release_STATICLIB) $(Release_LIBDEF) \
		Release\*.obj Release\*.@ $(Release_RESOURCE) \
		$(Release_PCH) $(Release_PDB) $(Release_OTHER)) DO @IF EXIST "%i" DEL "%i"

Debug: Debug_DIR Debug_unfinished $(Debug_PCH) $(Debug_BIN)
!IFDEF YOURMOD
	-COPY "$(Debug_BIN)" "$(YOURMOD)\Assets\."
!ENDIF

Release: Release_DIR Release_unfinished $(Release_PCH) $(Release_BIN)
!IFDEF YOURMOD
	-COPY "$(Release_BIN)" "$(YOURMOD)\Assets\."
!ENDIF

Debug_DIR:
	-@IF NOT EXIST "Debug\." MKDIR "Debug"

Release_DIR:
	-@IF NOT EXIST "Release\." MKDIR "Release"

Debug_unfinished:
	@ECHO.>Debug\unfinished.@
	@FOR /F "delims=@" %i IN ('dir /b Debug\*.@') DO \
		@IF EXIST "Debug\%i" DEL "Debug\%i"
	@FOR /F %i IN ('dir /b Debug\*.@') DO \
		@IF EXIST "Debug\%i" DEL "Debug\%i"

Release_unfinished:
	@ECHO.>Release\unfinished.@
	@FOR /F "delims=@" %i IN ('dir /b Release\*.@') DO \
		@IF EXIST "Release\%i" DEL "Release\%i"
	@FOR /F %i IN ('dir /b Release\*.@') DO \
		@IF EXIST "Release\%i" DEL "Release\%i"

$(Debug_BIN): $(Debug_LINKOBJS) $(Debug_RESOURCE)
	$(LD) /out:$(Debug_BIN) $(Debug_LDFLAGS) $(Debug_LIBS) $(Debug_LINKOBJS) $(Debug_RESOURCE)

$(Release_BIN): $(Release_LINKOBJS) $(Release_RESOURCE)
	$(LD) /out:$(Release_BIN) $(Release_LDFLAGS) $(Release_LIBS) $(Release_LINKOBJS) $(Release_RESOURCE)

.cpp{Debug}.obj:
	@ECHO.>"$*.obj.@"
    $(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /Fo$*.obj /c $<
	@DEL "$*.obj.@"

.cpp{Release}.obj:
	@ECHO.>"$*.obj.@"
    $(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /Fo$*.obj /c $<
	@DEL "$*.obj.@"

$(Debug_PCH) Debug\_precompile.obj:
	@ECHO.>"$(Debug_PCH).@"
	@ECHO.>"Debug\_precompile.obj.@"
	$(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /YcCvGameCoreDLL.h /Fo"Debug\_precompile.obj" /c _precompile.cpp
	@DEL "$(Debug_PCH).@"
	@DEL "Debug\_precompile.obj.@"

$(Release_PCH) Release\_precompile.obj:
	@ECHO.>"$(Release_PCH).@"
	@ECHO.>"Release\_precompile.obj.@"
    $(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /YcCvGameCoreDLL.h /Fo"Release\_precompile.obj" /c _precompile.cpp
	@DEL "$(Release_PCH).@"
	@DEL "Release\_precompile.obj.@"

.rc{Debug}.res:
	@ECHO.>"$*.res.@"
	$(RC) /Fo$@ $(Debug_INCS) $<
	@DEL "$*.res.@"

.rc{Release}.res:
	@ECHO.>"$*.res.@"
	$(RC) /Fo$@ $(Release_INCS) $<
	@DEL "$*.res.@"

!IFDEF BLACKLIST

Debug\$(BLACKLIST).obj: $(BLACKLIST).cpp
	@ECHO.>"$*.obj.@"
	@ECHO.>"$*-dummy.cpp"
	$(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /Y- /Fo$@ /c "$*-dummy.cpp"
	@DEL "$*-dummy.cpp"
	@DEL "$*.obj.@"

Release\$(BLACKLIST).obj: $(BLACKLIST).cpp
	@ECHO.>"$*.obj.@"
	@ECHO.>"$*-dummy.cpp"
	$(CPP) /nologo $(Release_CFLAGS) $(Release_INCS) /Y- /Fo$@ /c "$*-dummy.cpp"
	@DEL "$*-dummy.cpp"
	@DEL "$*.obj.@"

!ENDIF

!IFDEF FD

!IF [IF NOT EXIST $(FD) EXIT 1] == 0
!IF [$(FD) --objectextension=pch -q -O Debug CvGameCoreDLL.cpp > depends] != 0 || \
    [$(FD) --objectextension=obj -q -O Debug $(SOURCES) >> depends] != 0 || \
    [$(FD) --objectextension=pch -q -O Release CvGameCoreDLL.cpp >> depends] != 0 || \
    [$(FD) --objectextension=obj -q -O Release $(SOURCES) >> depends] != 0
!MESSAGE Error running fastdep.
!ENDIF
!ELSE
!IF [ECHO "fastdep.exe" NOT FOUND! && \
     ECHO Please edit Makefile to reflect the correct path of fastdep. && \
     ECHO. ]
!ENDIF
!ENDIF

!ENDIF

!IF EXIST(depends)
!INCLUDE depends
!ENDIF

I also added both the .lib files to my "$(TOOLKIT)/lib" folder, this is the output from the build starting just after FDialogTemplate.

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 CxImage.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 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>CxImage.lib(ximawnd.obj) : error LNK2001: unresolved external symbol __imp__DeleteObject@4
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>CxImage.lib(ximawnd.obj) : error LNK2001: unresolved external symbol __imp__BitBlt@36
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>CxImage.lib(ximawnd.obj) : error LNK2001: unresolved external symbol __imp__SelectObject@8
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>CxImage.lib(ximawnd.obj) : error LNK2001: unresolved external symbol __imp__CreateCompatibleBitmap@12
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>CxImage.lib(ximawnd.obj) : error LNK2001: unresolved external symbol __imp__CreateCompatibleDC@4
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__CreateDIBitmap@24 referenced in function "public: struct HBITMAP__ * __thiscall CxImage::MakeBitmap(struct HDC__ *)" (?MakeBitmap@CxImage@@QAEPAUHBITMAP__@@PAUHDC__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "public: struct HBITMAP__ * __thiscall CxImage::MakeBitmap(struct HDC__ *)" (?MakeBitmap@CxImage@@QAEPAUHBITMAP__@@PAUHDC__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__CreateDIBSection@24 referenced in function "public: struct HBITMAP__ * __thiscall CxImage::MakeBitmap(struct HDC__ *)" (?MakeBitmap@CxImage@@QAEPAUHBITMAP__@@PAUHDC__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__GetDIBits@28 referenced in function "public: bool __thiscall CxImage::CreateFromHBITMAP(struct HBITMAP__ *,struct HPALETTE__ *)" (?CreateFromHBITMAP@CxImage@@QAE_NPAUHBITMAP__@@PAUHPALETTE__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__RealizePalette@4 referenced in function "public: bool __thiscall CxImage::CreateFromHBITMAP(struct HBITMAP__ *,struct HPALETTE__ *)" (?CreateFromHBITMAP@CxImage@@QAE_NPAUHBITMAP__@@PAUHPALETTE__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__GetObjectA@12 referenced in function "public: bool __thiscall CxImage::CreateFromHBITMAP(struct HBITMAP__ *,struct HPALETTE__ *)" (?CreateFromHBITMAP@CxImage@@QAE_NPAUHBITMAP__@@PAUHPALETTE__@@@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__SetDIBitsToDevice@48 referenced in function "public: long __thiscall CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QAEJPAUHDC__@@JJJJPAUtagRECT@@_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__SetStretchBltMode@8 referenced in function "public: long __thiscall CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QAEJPAUHDC__@@JJJJPAUtagRECT@@_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__ExtSelectClipRgn@12 referenced in function "public: long __thiscall CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QAEJPAUHDC__@@JJJJPAUtagRECT@@_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__CreateRectRgnIndirect@4 referenced in function "public: long __thiscall CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QAEJPAUHDC__@@JJJJPAUtagRECT@@_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__GetClipBox@8 referenced in function "public: long __thiscall CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QAEJPAUHDC__@@JJJJPAUtagRECT@@_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__StretchBlt@44 referenced in function "public: long __thiscall CxImage::Draw2(struct HDC__ *,long,long,long,long)" (?Draw2@CxImage@@QAEJPAUHDC__@@JJJJ@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__SetBkColor@8 referenced in function "public: long __thiscall CxImage::Draw2(struct HDC__ *,long,long,long,long)" (?Draw2@CxImage@@QAEJPAUHDC__@@JJJJ@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__CreateBitmap@20 referenced in function "public: long __thiscall CxImage::Draw2(struct HDC__ *,long,long,long,long)" (?Draw2@CxImage@@QAEJPAUHDC__@@JJJJ@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__RectVisible@8 referenced in function "public: long __thiscall CxImage::Draw2(struct HDC__ *,long,long,long,long)" (?Draw2@CxImage@@QAEJPAUHDC__@@JJJJ@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__StretchDIBits@52 referenced in function "public: long __thiscall CxImage::Draw2(struct HDC__ *,long,long,long,long)" (?Draw2@CxImage@@QAEJPAUHDC__@@JJJJ@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__SetBkMode@8 referenced in function "public: long __thiscall CxImage::DrawString(struct HDC__ *,long,long,char const *,struct tagRGBQUAD,char const *,long,long,unsigned char,unsigned char,bool)" (?DrawString@CxImage@@QAEJPAUHDC__@@JJPBDUtagRGBQUAD@@1JJEE_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__SetTextColor@8 referenced in function "public: long __thiscall CxImage::DrawString(struct HDC__ *,long,long,char const *,struct tagRGBQUAD,char const *,long,long,unsigned char,unsigned char,bool)" (?DrawString@CxImage@@QAEJPAUHDC__@@JJPBDUtagRGBQUAD@@1JJEE_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function "public: long __thiscall CxImage::DrawString(struct HDC__ *,long,long,char const *,struct tagRGBQUAD,char const *,long,long,unsigned char,unsigned char,bool)" (?DrawString@CxImage@@QAEJPAUHDC__@@JJPBDUtagRGBQUAD@@1JJEE_N@Z)
1>CxImage.lib(ximawnd.obj) : error LNK2019: unresolved external symbol __imp__CreateFontIndirectA@4 referenced in function "public: long __thiscall CxImage::DrawString(struct HDC__ *,long,long,char const *,struct tagRGBQUAD,char const *,long,long,unsigned char,unsigned char,bool)" (?DrawString@CxImage@@QAEJPAUHDC__@@JJPBDUtagRGBQUAD@@1JJEE_N@Z)
1>Release\CvGameCoreDLL.dll : fatal error LNK1120: 25 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"
1>Build log was saved at "file://c:\Users\Michael\Documents\My Civ4 Projects\Test\CvGameCoreDLL\Release\BuildLog.htm"
1>CvGameCoreDLL - 33 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Did I not put the files in the right spot? Did I change the Makefile appropriately?
 
I put the libs directly in my SDK folder, but what you did should work. It looks like it's missing other libraries. BULL has two libs I don't see included there: gdi32.lib and Ole32.lib. I got them originally by Googling for them and putting them into my toolkit or PSDK lib folder as you did with the CxImage libs. I bet that's the missing piece.
 
Compiled

Code:
1>CvGameCoreDLL - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Didn't CTD on Startup about to play a game of my "New Folder" mod (Better BUG AI with the above settings)

Yay!! Thank You EF!
 
Yay, I got Danny's makefile to work with the static library! Maybe I can figure out how to statically include those two extra libraries in my CxImage library to make it even easier.
 
Yay, I got Danny's makefile to work with the static library! Maybe I can figure out how to statically include those two extra libraries in my CxImage library to make it even easier.

Or just bundle them with a Tutorial PDF and Danny's Makefile and upload them as an update to Refar's Makefile tutorial?
 
Yes, that's probably what I'll end up doing. I'm sure I'll be violating Microsoft's copyrights, but I doubt they'll C&D me. :)
 
Saw this thread, and just finished merging in the latest Better BUG AI SVN into RevDCM. Figured I'd try to readd the CxImage stuff, and see if it would work now. No dice, get this error on compiling:

1>LINK : fatal error LNK1181: cannot open input file 'CxImage_debug.lib'

What I did was add the folders include, lib, and CxImage (exported via tortoise) to the RevDCM source. Then I compared the Better BUG AI makefile with RevDCMs and made any adjustments that seemed necessary for this CxImage stuff to work. Went to the projects stuff in MVS, and selected "Add existing item, ctr-a to add add, and tried to compile. Got that error above, so I deleted all the MVS stuff and started a new project, still getting the same error. What am I missing? I'm including the RevDCM makefile, which is pretty much the same as Better BUG AI's now (which itself is pretty much a clone of BULL's), except for the fact with RevDCM we removed all the seperate Boost and Python folder stuff, and just follow the original directions, ie these folders are just included in the main working directory along with all the source.
 
Top Bottom