Afforess
The White Wizard
No; Jdog or whomever removed all the CvXImage stuff from RevDCM a while ago.
CxImage is to allow Map Finder to do screenshots.
You didn't change the make commands.
Essentially, everywhere in that guide where it says "Final_Release", change it to "Release".
Where it says clean_Debug and clean_Final_Release, change it to Debug_clean and Release_clean.
I think that's it.
Only difference from mine is that it is Release, not release. Same goes for Debug.
void CyCityPythonInterface1(python::class_<CyCity>& x)
{
OutputDebugString("Python Extension Module - CyCityPythonInterface1\n");
x
.def("isNone", &CyCity::isNone, "void () - is the instance valid?")
// rest of .def() definitions here
.def("getEspionageDefenseModifier", &CyCity::getEspionageDefenseModifier, "int ()")
;
}
void CyCityPythonInterface2(python::class_<CyCity>& x)
{
OutputDebugString("Python Extension Module - CyCityPythonInterface2\n");
x
.def("isWorkingPlotByIndex", &CyCity::isWorkingPlotByIndex, "bool (iIndex) - true if a worker is working this city's plot iIndex")
// rest of .def() definitions here
.def("isHasBuildingClass", &CyCity::isHasBuildingClass, "bool (int /*BuildingClassTypes*/ eBuildingClass)")
;
}
Did you also add your new CyCityInterface2 to CvDLLPython? Just search for CyCityPythonInterface1 and you should find where you should add them.
PS: I had the same problem.
Hello,
I'm trying to use this makefile with no success.
...
I'm sure I'm missing something blatantly easy, but I can't come up with it. Any suggestions? I'm using VS2010.
Cheers,
ripple01
I have a suggestion, use the VS2010 project files! I've just attached them to the original post. Let me know if they work for you. I am also thinking about building project files for other versions of Visual Studio. I might not get around to it though.
I was also thinking of packaging up the whole project, source and all, just to make it easier. Preferably with the unofficial patch. But, lets just try this to start.
CIV = C:\Games\Civ4\Beyond the Sword
SDK = $(CIV)\CvGameCoreDLL
BOOST = $(SDK)\Boost-1.32.0
PYTHON = $(SDK)\Python24
BIN = C:\Coding\Civ\SDK\bin
## Uncomment to have newly compiled dlls copied to your mod's Assets directory
COPYTO = $(CIV)\Assets
#### Civilization 4 SDK Makefile 1.0 ####
#### Copyright 2010 Danny Daemonic ####
#########################################
#### Paths ####
TOOLKIT = C:\Coding\Microsoft Visual C++ Toolkit 2003
PSDK = C:\Program Files\Microsoft Platform SDK
BIN = C:\Coding\Civ\SDK\bin
CIV = C:\Games\Civ4\Beyond the Sword
SDK = $(CIV)\CvGameCoreDLL
BOOST = $(SDK)\Boost-1.32.0
PYTHON = $(SDK)\Python24
## Uncomment to have newly compiled dlls copied to your mod's Assets directory
COPYTO = $(CIV)\Assets
#### Tools ####
CC="$(TOOLKIT)\bin\cl.exe"
CPP="$(TOOLKIT)\bin\cl.exe"
LD="$(TOOLKIT)\bin\link.exe"
RC="$(PSDK)\bin\rc.exe"
#FD="$(BIN)\fastdep.exe"
#### BLACKLIST ####
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 /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h"
# /Zi
Debug_CFLAGS=/MDd /Od /D_DEBUG /RTC1 /Fp"$(Debug_PCH)" $(GLOBAL_CFLAGS)
Release_CFLAGS=/MD /O2 /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) /NODEFAULTLIB:msvcprtd.lib
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=/I"$(BOOST)/include" /I"$(PYTHON)/include" /I"CxImage/general" /I"CxImage/jpeg"
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:"$(PYTHON)/libs" /LIBPATH:"$(BOOST)/libs/" boost_python-vc71-mt-1_32.lib gdi32.lib Ole32.lib
Debug_LIBS=$(PROJECT_LIBS) $(GLOBAL_LIBS) msvcprt.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 && \
[FOR %i IN (CxImage\general\*.cpp) DO @ECHO. "%i" \>> sources.mk] == 0 && \
# [FOR %i IN (CxImage\jpeg\*.c) 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 && \
[FOR /F "delims=." %i IN ('dir /b CxImage\general\*.cpp') DO @ECHO. Debug\CxImage\general\%i.obj \>> sources.mk] == 0 && \
# [FOR /F "delims=." %i IN ('dir /b CxImage\jpeg\*.c') DO @ECHO. Debug\CxImage\jpeg\%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 && \
[FOR /F "delims=." %i IN ('dir /b CxImage\general\*.cpp') DO @ECHO. Release\CxImage\general\%i.obj \>> sources.mk] == 0 && \
# [FOR /F "delims=." %i IN ('dir /b CxImage\jpeg\*.c') DO @ECHO. Release\CxImage\jpeg\%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 COPYTO
-COPY "$(Debug_BIN)" "$(COPYTO)\."
!ENDIF
Release: Release_DIR Release_unfinished $(Release_PCH) $(Release_BIN)
!IFDEF COPYTO
-COPY "$(Release_BIN)" "$(COPYTO)\."
!ENDIF
Debug_DIR:
-@IF NOT EXIST "Debug\." MKDIR "Debug"
-@IF NOT EXIST "Debug\CxImage\." MKDIR "Debug\CxImage"
-@IF NOT EXIST "Debug\CxImage\general\." MKDIR "Debug\CxImage\general"
-@IF NOT EXIST "Debug\CxImage\jpeg\." MKDIR "Debug\CxImage\jpeg"
Release_DIR:
-@IF NOT EXIST "Release\." MKDIR "Release"
-@IF NOT EXIST "Release\CxImage\." MKDIR "Release\CxImage"
-@IF NOT EXIST "Release\CxImage\general\." MKDIR "Release\CxImage\general"
-@IF NOT EXIST "Release\CxImage\jpeg\." MKDIR "Release\CxImage\jpeg"
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.@"
.c{Debug}.obj:
@ECHO.>"$*.obj.@"
$(CPP) /nologo $(Debug_CFLAGS) $(Debug_INCS) /Fo$*.obj /c $<
@DEL "$*.obj.@"
.c{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
Neither /ZI nor /Zi will work with larger source files because of the program database size limit. You will at least want to know the line numbers so you should add /Zd .
Can you get it to work if you just put everything into the $(SDK) folder?