Build Issues Help

CarnivalBizarre

Warlord
Joined
Sep 18, 2008
Messages
168
Location
Northen Sweden
Hi there. Trying to get CvGameCoreDLL to build for Master of Mana mod to get something to work on with, first time for me, but not novice with the studio etc etc.

I have some issues left, after getting the boost and python include into the project, some I cannot really understand that much.

I am using VS2013 and Windows 7 64 bit, have passed the SDK and other.

Can anyone give me any pointers to get around the build issues?

The Error list on debug build


Include in the project


My current MakeFile

#### Civilization 4 SDK Makefile ####
#### Copyright 2010 Danny Daemonic ####
#######################################

#### Paths ####
TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
PSDK=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A
CIVINSTALL=C:\Spel\Civ4\Beyond the Sword
GLOBALBOOST=$(CIVINSTALL)\CvGameCoreDLL\Boost-1.32.0
GLOBALPYTHON=$(CIVINSTALL)\CvGameCoreDLL\Python24
## Uncomment to have newly compiled dlls copied to your mod's Assets directory
YOURMOD=C:\Spel\Civ4\Beyond the Sword\Mods\Master of Mana Xtended SVN

#### 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="$(MAKEDIR)/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
#Debug_RESOURCE=Debug\CvGameCoreDLL.res
Debug_STATICLIB=Debug\CvGameCoreDLL.lib
Debug_LIBDEF=Debug\CvGameCoreDLL.def
Debug_PCH=Debug\CvGameCoreDLL.pch
Debug_PDB=Debug\CvGameCoreDLL.pdb
Debug_OTHER=Debug\CvGameCoreDLL.exp Debug\CvGameCoreDLL.ilk
Release_BIN=Release\CvGameCoreDLL.dll
#Release_RESOURCE=Release\CvGameCoreDLL.res
Release_STATICLIB=Release\CvGameCoreDLL.lib
Release_LIBDEF=Release\CvGameCoreDLL.def
Release_PCH=Release\CvGameCoreDLL.pch
Release_PDB=Release\CvGameCoreDLL.pdb
Release_OTHER=Release\CvGameCoreDLL.exp

#### CFLAGS ####
#GLOBAL_CFLAGS=/GR /Gy /W3 /EHsc /Gd /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h"
#Debug_CFLAGS=/MD /Zi /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS)
GLOBAL_CFLAGS=/GR /Gy /W3 /EHsc /Gd /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /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"
GLOBAL_INCS=/I"$(TOOLKIT)/include" /I"$(PSDK)/Include" /I"$(PSDK)/Include/mfc" /I"$(GLOBALBOOST)/include" /I"$(GLOBALPYTHON)/include"
PROJECT_INCS=/IBoost-1.32.0/include /IPython24/include /Itbb/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
GLOBAL_LIBS=/LIBPATH:"$(TOOLKIT)/lib" /LIBPATH:"$(PSDK)/Lib" /LIBPATH:"$(GLOBALBOOST)/libs" /LIBPATH:"$(GLOBALPYTHON)/libs" winmm.lib user32.lib
PROJECT_LIBS=/LIBPATH:python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib
#PROJECT_LIBS=/LIBPATH:python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib tbb.lib
Debug_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS) msvcprt.lib #/NODEFAULTLIB:msvcprtd.lib
Release_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS)

#### 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 [$(FD) --objectextension=obj -q -O Debug $(SOURCES) > depends] == 0 && \
[$(FD) --objectextension=obj -q -O Release $(SOURCES) >> depends] == 0
!ENDIF
!ENDIF

!IF EXIST(depends)
!INCLUDE depends
!ENDIF
 

Attachments

  • buildIssuesLeft.PNG
    buildIssuesLeft.PNG
    73.4 KB · Views: 414
  • includes.PNG
    includes.PNG
    36.1 KB · Views: 315
Were you able to build the vanilla bts dll?
If not, you could try that first, to rule out any things MoM-specific.

Edit: On a second thought, "InterlockedExchange" sounds like something with parallel programming. I think Sephi added parallelism to the AI code to improve performance. Are you using his Makefile?
 
Were you able to build the vanilla bts dll?
If not, you could try that first, to rule out any things MoM-specific.

Edit: On a second thought, "InterlockedExchange" sounds like something with parallel programming. I think Sephi added parallelism to the AI code to improve performance. Are you using his Makefile?

Yeah, I am using his Makefile, but I changed some things here and there thought, to get the boost and python links and such. I guess there might be something that got removed in those changes, hmmm
 
After putting TBB somewhere and using it in my VS project and makefile, those errors are now gone. Left with the one. Anyone got a hint here?



1> "C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/bin/link.exe" /out:Debug\CvGameCoreDLL.dll /INCREMENTAL /DEBUG /PDB:"Debug\CvGameCoreDLL.pdb" /IMPLIB:"Debug\CvGameCoreDLL.lib" /DLL /NOLOGO /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1 /LIBPATH:python24/libs /LIBPATH:boost-1.32.0/libs/ /LIBPATH:"C:\Spel\tbb43_20150209oss/lib/ia32/vc9/ boost_python-vc71-mt-1_32.lib tbb.lib /LIBPATH:"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A/Lib" /LIBPATH:"C:\Spel\Civ4\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/libs" /LIBPATH:"C:\Spel\Civ4\Beyond the Sword\CvGameCoreDLL\Python24/libs" winmm.lib user32.lib msvcprt.lib Debug\AI_Bonus.obj Debug\AI_ChooseProduction.obj Debug\AI_ChooseSpecialist.obj Debug\AI_ChooseTech.obj Debug\AI_Group.obj Debug\AI_GroupCityInvasion.obj Debug\AI_GroupSettle.obj Debug\AI_Hero.obj Debug\AI_Units.obj Debug\AI_War.obj Debug\CvArea.obj Debug\CvArtFileMgr.obj Debug\CvBarbarians.obj Debug\CvCity.obj Debug\CvCityAI.obj Debug\CvCombatAura.obj Debug\CvDeal.obj Debug\CvDiploParameters.obj Debug\CvDLLButtonPopup.obj Debug\CvDLLEntity.obj Debug\CvDLLPython.obj Debug\CvDllPythonEvents.obj Debug\CvDllTranslator.obj Debug\CvDLLWidgetData.obj Debug\CvDungeon.obj Debug\CvEventReporter.obj Debug\CvFractal.obj Debug\CvGame.obj Debug\CvGameAI.obj Debug\CvGameCoreDLL.obj Debug\CvGameCoreUtils.obj Debug\CvGameInterface.obj Debug\CvGameTextMgr.obj Debug\CvGlobals.obj Debug\CvHallOfFameInfo.obj Debug\CvImprovementSystem.obj Debug\CvInfos.obj Debug\CvInfoWater.obj Debug\CvInitCore.obj Debug\CvMap.obj Debug\CvMapGenerator.obj Debug\CvMessageControl.obj Debug\CvMessageData.obj Debug\CvPlayer.obj Debug\CvPlayerAI.obj Debug\CvPlot.obj Debug\CvPlotGroup.obj Debug\CvPopupInfo.obj Debug\CvPopupReturn.obj Debug\CvRandom.obj Debug\CvReplayInfo.obj Debug\CvReplayMessage.obj Debug\CvSelectionGroup.obj Debug\CvSelectionGroupAI.obj Debug\CvStatistics.obj Debug\CvStructs.obj Debug\CvTalkingHeadMessage.obj Debug\CvTeam.obj Debug\CvTeamAI.obj Debug\CvTextScreens.obj Debug\CvUnit.obj Debug\CvUnitAI.obj Debug\CvViewport.obj Debug\CvWinamp.obj Debug\CvXMLLoadUtility.obj Debug\CvXMLLoadUtilityGet.obj Debug\CvXMLLoadUtilityInit.obj Debug\CvXMLLoadUtilityModTools.obj Debug\CvXMLLoadUtilitySet.obj Debug\CvXMLLoadUtilitySetMod.obj Debug\CyArea.obj Debug\CyAreaInterface.obj Debug\CyArgsList.obj Debug\CyArtFileMgr.obj Debug\CyArtFileMgrInterface.obj Debug\CyCity.obj Debug\CyCityInterface1.obj Debug\CyCityInterface2.obj Debug\CyCombatAura.obj Debug\CyCombatAuraInterface.obj Debug\CyDeal.obj Debug\CyEnumsInterface.obj Debug\CyGame.obj Debug\CyGameCoreUtils.obj Debug\CyGameCoreUtilsInterface.obj Debug\CyGameInterface.obj Debug\CyGameTextMgr.obj Debug\CyGameTextMgrInterface.obj Debug\CyGlobalContext.obj Debug\CyGlobalContextInterface1.obj Debug\CyGlobalContextInterface2.obj Debug\CyGlobalContextInterface3.obj Debug\CyGlobalContextInterface4.obj Debug\CyHallOfFameInfo.obj Debug\CyHallOfFameInterface.obj Debug\CyInfoInterface1.obj Debug\CyInfoInterface2.obj Debug\CyInfoInterface3.obj Debug\CyInfoInterface4.obj Debug\CyMap.obj Debug\CyMapGenerator.obj Debug\CyMapGeneratorInterface.obj Debug\CyMapInterface.obj Debug\CyMessageControl.obj Debug\CyMessageControl2.obj Debug\CyMessageControlInterface.obj Debug\CyPlayer.obj Debug\CyPlayerInterface1.obj Debug\CyPlayerInterface2.obj Debug\CyPlot.obj Debug\CyPlotInterface1.obj Debug\CyRandomInterface.obj Debug\CyReplayInfo.obj Debug\CySelectionGroup.obj Debug\CySelectionGroupInterface.obj Debug\CySelectionGroupInterface2.obj Debug\CyStructsInterface1.obj Debug\CyTeam.obj Debug\CyTeamInterface.obj Debug\CyUnit.obj Debug\CyUnitInterface1.obj Debug\CyWinamp.obj Debug\CyWinampInterface.obj Debug\FAssert.obj Debug\FDialogTemplate.obj Debug\Hilfsfunktionen.obj Debug\Pathfinding.obj Debug\ThreadObject.obj Debug\ThreadOrganizer.obj Debug\TimeMeasure.obj Debug\Tree.obj Debug\_precompile.obj

1>LINK : fatal error LNK1181: cannot open input file 'Files.obj'

1>NMAKE : warning U4010: 'Debug\CvGameCoreDLL.dll' : build failed; /K specified, continuing ...

1>NMAKE : warning U4011: 'Debug' : not all dependents available; target not built

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "nmake /NOLOGO /K Debug" exited with code 1.
 

Attachments

  • BuildIssuesLeft2.PNG
    BuildIssuesLeft2.PNG
    4.9 KB · Views: 256
That error is quite odd. I would say that since you changed the makefile, you should try to rebuild. That way files "dirtied" by your previous failed attempt will be recompiled.

I just don't quite get that error though because it looks like the linker haven't been given that filename meaning it shouldn't be looking for it. I would check if a file exist, which is called Files.cpp.
 
That error is quite odd. I would say that since you changed the makefile, you should try to rebuild. That way files "dirtied" by your previous failed attempt will be recompiled.

I just don't quite get that error though because it looks like the linker haven't been given that filename meaning it shouldn't be looking for it. I would check if a file exist, which is called Files.cpp.

Thanks for your thoughts.

I think I was barking up the wrong tree about the TBB lib, it is never used in code, all usages are commented out, so I think Sephi just played around with it, meaning it should never have been an issue at all? It is not needed for anything at least.

InterlockedExchange stuff just drove me mad, so I let this rest for a few days. Gonna give it some new tries tonight by trying to recreate how Sephi must have had his setup, his original MakeFile had no global references to PythonBoost and Python so I guess he copied it into his "workspace" etc etc. But I cannot see how that would make it difference, but maybe I messed something up when I thought I was improving it.

I found nothing regarding Files.Obj and Files.* it just seems that the linker has something it does not know the name of as you said. Very wierd. :confused:
 
I manged to build it last night though only in release. The Debug version still get's all these pesky InterlockedExchange issues. Will look through that more, without debug stepping it is way more timeconsuming to find all the bugs that I have grown to hate over the years.
 
Update, got it working in debug also yesterday.

The SDK was the issue, there was inherited includes to the current SDK that messed things up, even if the makefile and another SDK include was added. Also, Sal.h was from VS2013 which was not good.

Finally.... sigh (talking to yourself on a almost dead board is not a good sign)
 
The "Files" thing appears to be a case of missing a double-quote.

This line of the output shows the problem:
/LIBPATH:"C:\Spel\tbb43_20150209oss/lib/ia32/vc9/ boost_python-vc71-mt-1_32.lib tbb.lib /LIBPATH:"C:\Program Files
There is no double-quote at the end of the first library. There should be one right after the .lib before the tbb.lib specification. That leaves most of the line inside the quotes and then the C:\Program text crammed up against the closing (but supposed to be opening) double-quote which presumably concatenates it, but then you have the freestanding word Files which it tries to parse and assumes it is a file and it is given the default file extension of .obj because that is what the linker mainly deals with.

I think.

Maybe.
 
Top Bottom