[SDK] Using Microsoft Visual C++ 2005 Express Edition

Okay, I tried compiling the SDK files using smacfan's makefile and following Chazcon's instructions, but the whole process gets shot down early in the process with this error:

1>NMAKE : fatal error U1052: file 'Final_Release' not found

I have no clue what I'm doing wrong here. For what it's worth, I am only compiling the SDK with Bhruic's files, and my changes were very very minor (one line in two files). Help!
 
Deja, I do remember trying to get your system and your makefile to work way back when, especially because I was determined to use VS2005 to mod the SDK. On your original thread another poster couldn't get it to work. On 11/30/06 on that same thread I posted, asking: "So...this solution does not work? What is the status on this? I'd MUCH rather play with code in Visual C++ 2005 Express than Code::Blocks..." No reply, no PM, and it didn't work for me so I moved on.

I was searching for a way to mod the SDK and discovered the method I posted into this thread, none of which is my original work, I simply combined and organized the work of DaveMcW, Kael, and Maian.

I did not include your makefile or any of your work in this thread - if you feel bruised I do apologize. The proper venue would have been to send me a message in private, where I would happily have discussed this with you. Perhaps supporting your original thread (my question was the last post on 11/30/06) might have gained you more chubby points than hijacking this one, jumping up and down, and screaming "What about ME ?!?"

Being a valid and contributing member of a the game modding community is important to me, and I certainly don't want to step on anyone's toes. I have always given credit where credit is due. I absolutely do not take credit for anyone else's code or other work. That goes for the Civ forums here and the many other game mod forums I've been active on over the years.

Cheers,

- Chazcon

I'm a big fan of better late than never. I'm sorry. I'm reading over my posts here and I must have been having a really bad day.

No hard feelings, mate?
 
By the bye, better late than never is regarding MY apology, not yours. :)
 
No worries Deja, we're all part of a unique group here, that gets more out of modding games than playing them I think - at least that seems to be my experience :)

Looking forward to becoming more active on these forums, as soon as my other projects are finished...
 
:( :( I am going CRAZY!!! I cannot compile this .dll and I am not lying when I say I have been trying off and on for months. This is the third time I tried vc 2005, and although codeblocks finishes the compile, it crashes after, despite my having only changed the max civilizations in cvdefines.h.
Here's the message:

Build Log Build started: Project: CvGameCoreDLL, Configuration: Final_Release|Win32
Command Lines Creating temporary file "C:\Users\Carson\AppData\Local\Temp\BAT000008496392.bat" with contents
[
@echo off

nmake Final_Release

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"

exit 1

:VCEnd
]
Creating command line "C:\Users\Carson\AppData\Local\Temp\BAT000008496392.bat"
Output Window Performing Makefile project actions
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/link.exe" /dll /nologo /LIBPATH:python24/libs /LIBPATH:boost-1.32.0/libs/ /LIBPATH:"C:/Program Files/Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Lib" /out:Final_Release/CvGameCoreDLL.dll boost_python-vc71-mt-1_32.lib winmm.lib user32.lib Final_Release/CvArea.obj Final_Release/CvArtFileMgr.obj Final_Release/CvCity.obj Final_Release/CvCityAI.obj Final_Release/CvDLLButtonPopup.obj Final_Release/CvDLLEntity.obj Final_Release/CvDLLPython.obj Final_Release/CvDLLWidgetData.obj Final_Release/CvDeal.obj Final_Release/CvDiploParameters.obj Final_Release/CvFractal.obj Final_Release/CvGame.obj Final_Release/CvGameAI.obj Final_Release/CvGameCoreDLL.obj Final_Release/CvGameCoreUtils.obj Final_Release/CvGameTextMgr.obj Final_Release/CvGlobals.obj Final_Release/CvHallOfFameInfo.obj Final_Release/CvInfoWater.obj Final_Release/CvInfos.obj Final_Release/CvInitCore.obj Final_Release/CvMap.obj Final_Release/CvMapGenerator.obj Final_Release/CvPlayer.obj Final_Release/CvPlayerAI.obj Final_Release/CvPlot.obj Final_Release/CvPlotGroup.obj Final_Release/CvPopupInfo.obj Final_Release/CvPopupReturn.obj Final_Release/CvRandom.obj Final_Release/CvReplayInfo.obj Final_Release/CvReplayMessage.obj Final_Release/CvSelectionGroup.obj Final_Release/CvSelectionGroupAI.obj Final_Release/CvStructs.obj Final_Release/CvTalkingHeadMessage.obj Final_Release/CvTeam.obj Final_Release/CvTeamAI.obj Final_Release/CvUnit.obj Final_Release/CvUnitAI.obj Final_Release/CvXMLLoadUtility.obj Final_Release/CvXMLLoadUtilityGet.obj Final_Release/CvXMLLoadUtilityInit.obj Final_Release/CvXMLLoadUtilitySet.obj Final_Release/CyArea.obj Final_Release/CyAreaInterface.obj Final_Release/CyArgsList.obj Final_Release/CyArtFileMgr.obj Final_Release/CyArtFileMgrInterface.obj Final_Release/CyCity.obj Final_Release/CyCityInterface1.obj Final_Release/CyDeal.obj Final_Release/CyEnumsInterface.obj Final_Release/CyGame.obj Final_Release/CyGameCoreUtils.obj Final_Release/CyGameCoreUtilsInterface.obj Final_Release/CyGameInterface.obj Final_Release/CyGameTextMgr.obj Final_Release/CyGameTextMgrInterface.obj Final_Release/CyGlobalContext.obj Final_Release/CyGlobalContextInterface1.obj Final_Release/CyGlobalContextInterface2.obj Final_Release/CyGlobalContextInterface3.obj Final_Release/CyGlobalContextInterface4.obj Final_Release/CyHallOfFameInfo.obj Final_Release/CyHallOfFameInterface.obj Final_Release/CyInfoInterface1.obj Final_Release/CyInfoInterface2.obj Final_Release/CyInfoInterface3.obj Final_Release/CyMap.obj Final_Release/CyMapGenerator.obj Final_Release/CyMapGeneratorInterface.obj Final_Release/CyMapInterface.obj Final_Release/CyPlayer.obj Final_Release/CyPlayerInterface1.obj Final_Release/CyPlot.obj Final_Release/CyPlotInterface1.obj Final_Release/CyRandomInterface.obj Final_Release/CyReplayInfo.obj Final_Release/CySelectionGroup.obj Final_Release/CySelectionGroupInterface.obj Final_Release/CyStructsInterface1.obj Final_Release/CyTeam.obj Final_Release/CyTeamInterface.obj Final_Release/CyUnit.obj Final_Release/CyUnitInterface1.obj Final_Release/FAssert.obj Final_Release/FDialogTemplate.obj Final_Release/_precompile.obj /debug /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF
Creating library Final_Release/CvGameCoreDLL.lib and object Final_Release/CvGameCoreDLL.exp
CvCityAI.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::getSaveData(enum ExtraSaveDataType,int,int,int,int &)" (?getSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHAAH@Z) referenced in function "public: void __thiscall CvCityAI::read(class FDataStreamBase *)" (?read@CvCityAI@@QAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CvExtraSaveData::getSaveData(enum ExtraSaveDataType,int,int,int,int &)" (?getSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHAAH@Z)
CvPlayerAI.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::getSaveData(enum ExtraSaveDataType,int,int,int,int &)" (?getSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHAAH@Z) referenced in function "public: virtual bool __thiscall CvPlayerAI::AI_demandRebukedWar(enum PlayerTypes)" (?AI_demandRebukedWar@CvPlayerAI@@UAE_NW4PlayerTypes@@@Z)
CvTeamAI.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CvExtraSaveData::getSaveData(enum ExtraSaveDataType,int,int,int,int &)" (?getSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHAAH@Z)
CvCityAI.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setSaveData(enum ExtraSaveDataType,int,int,int,int)" (?setSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHH@Z) referenced in function "protected: void __thiscall CvCityAI::writeExtraSaveData(class CvExtraSaveData &)" (?writeExtraSaveData@CvCityAI@@IAEXAAVCvExtraSaveData@@@Z)
CvMap.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setSaveData(enum ExtraSaveDataType,int,int,int,int)" (?setSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHH@Z)
CvPlayerAI.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setSaveData(enum ExtraSaveDataType,int,int,int,int)" (?setSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHH@Z)
CvTeamAI.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setSaveData(enum ExtraSaveDataType,int,int,int,int)" (?setSaveData@CvExtraSaveData@@QAE_NW4ExtraSaveDataType@@HHHH@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::invalidate(void)" (?invalidate@CvExtraSaveData@@QAE_NXZ) referenced in function "public: void __thiscall CvMap::doTurn(void)" (?doTurn@CvMap@@QAEXXZ)
CvMap.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CvExtraSaveData::~CvExtraSaveData(void)" (??1CvExtraSaveData@@UAE@XZ) referenced in function "public: virtual __thiscall CvMap::~CvMap(void)" (??1CvMap@@UAE@XZ)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::cleanPlotValues(class CvMap &)" (?cleanPlotValues@CvExtraSaveData@@QAE_NAAVCvMap@@@Z) referenced in function "public: virtual void __thiscall CvMap::read(class FDataStreamBase *)" (?read@CvMap@@UAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setupForRead(class CvMap &)" (?setupForRead@CvExtraSaveData@@QAE_NAAVCvMap@@@Z) referenced in function "public: virtual void __thiscall CvMap::read(class FDataStreamBase *)" (?read@CvMap@@UAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::restorePlotValues(class CvMap &)" (?restorePlotValues@CvExtraSaveData@@QAE_NAAVCvMap@@@Z) referenced in function "public: virtual void __thiscall CvMap::write(class FDataStreamBase *)" (?write@CvMap@@UAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::writeToPlots(class CvMap &)" (?writeToPlots@CvExtraSaveData@@QAE_NAAVCvMap@@@Z) referenced in function "public: virtual void __thiscall CvMap::write(class FDataStreamBase *)" (?write@CvMap@@UAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CvExtraSaveData::setupForWrite(class CvMap &)" (?setupForWrite@CvExtraSaveData@@QAE_NAAVCvMap@@@Z) referenced in function "public: virtual void __thiscall CvMap::write(class FDataStreamBase *)" (?write@CvMap@@UAEXPAVFDataStreamBase@@@Z)
CvMap.obj : error LNK2019: unresolved external symbol "public: __thiscall CvExtraSaveData::CvExtraSaveData(void)" (??0CvExtraSaveData@@QAE@XZ) referenced in function "public: __thiscall CvMap::CvMap(void)" (??0CvMap@@QAE@XZ)
Final_Release/CvGameCoreDLL.dll : fatal error LNK1120: 10 unresolved externals
NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/link.exe"' : return code '0x460'
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
Results Build log was saved at "file://c:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Warlords\Mods\Total Realism\TRWARLORDSCvGameCoreDLL\CvGameCoreDLL\Final_Release\BuildLog.htm"
CvGameCoreDLL - 19 error(s), 0 warning(s)


Anyone that helps will gain good karma;)
 
Yes, VS 2005 Express can be made to work for BTS (it's what I use) and the tutorial should be a good guide. I followed it to get things working, but I don't remember if there were any changes necessary ... sorry. You may need a BTS makefile, I think one was posted in this thread though.

Good luck.
 
I've just tried building the DLL using VS 2008 Express successfully. There is absolutely nothing to change from the instructions in the first post. VS 2008 has the same interface as 2005. The great advantage 2008 has is that the express version comes with the PSDK already bundled with it so you no longer need to download it separately. The SDK is installed in "C:\Program Files\Microsoft SDKs\Windows\v6.0A" no matter where you chose to install VS 2008 Express. The above path should be the one you add to the Makefile.

I also used the makefile in the first post with one modification to work with BTS 3.13. There is an additional .cpp file that should be added to the build process. I attached this Makefile in case anybody likes to use it. Make sure to change the VS 2003 toolkit location to where it is installed on your PC.

So far I've noticed nothing new with 2008 that worth moving to it from 2005. Those who have 2005 don't need to get it. I however recommend it for anyone who is just starting to work on the DLL.
 
Step 10 says:
10 - 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-.


I'm using Visual Studio 2008. Everything seems mostly the same except when I try Step 10. When I select all the contents and click 'ok' I get an error saying that a .ncb file is in use. Apparently the compiler is saving something into that folder, but I'm not sure. My current structure is C:\Mymod\CvGameCoreDLL for the BTS CvGameCoreDLL folder. Any advice?
 
@ocitalis

In the add existing item dialog box the drop down menu for file type, select C++ file type rather than all. This will constrains files displayed. When you select all the files then the .ncb file will no longer be selected.
 
Thank You to everybody i've found in the posts that my problem was the makefile, the first i've used was not for bts


1>Final_Release/CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
1>NMAKE : fatal error U1077: '"C:/Programmi/Microsoft Visual C++ Toolkit 2003/bin/link.exe"' : codice restituito '0x460'
1>Stop.
1>Project : error PRJ0019: Uno strumento ha restituito un codice di errore da "Esecuzione azioni progetto Makefile"
1>Il log di compilazione è stato salvato in 'file://c:\Programmi\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Pritz RED Europa\WorkingFolderDll\CvGameCoreDLL\Final_Release\BuildLog.htm'
1>CvGameCoreDLL - 4 errore/i, 0 avviso/i
========== Compilazione: 0 completate, 1 non riuscite, 0 aggiornate, 0 ignorate ==========

To me too happened this...? I used visual basic 2008 express edition and compiled from bts 3.13 following Your instructions for warlords, Is this the problem?
 
I'm using BTS 3.13.
After having found the right MakeFile, it compiles and works!
I've tried some slight change, and it works! It seemed allright!
However, after having changed a .h file, compilation doesn't work anymore. It tells me an error about the precompile.obj, and any new variable I define in the .h file remains as undefined.
I have to completely clean the output folder before compilation could be done.
Is this an issue of the makefile?
 
I can't be sure if I understood your post properly. If the removal of the output folder solves the problem then yes this is how the available makefile works. Is it an issue? Yes it is. The makefile should include h files dependencies so that when any of them is changed the affected cpp files will be recompiled and obj files updated without the need for a whole rebuild. This will save a lot of time especially for those who make many changes and want to make sure each change didn't miss-up things.

I think someone has posted a dependency file that can be included within the makefile. There is also a tool that will create such dependency file. I used it under Linux and it works with cygwin but I am not sure if there is one that works on windows without the need for cygwin.
 
Using the dependency file I also usually have to clean or rebuild after making changes to a header file with the same error about precompile.obj you get ViterboKnight. I haven't looked into why it happens, but it must be some issue with the handling of precompile in the make file ... the workaround (rebuilding from scratch) has proven functional enough that I haven't felt a need to dive in.
 
I can't find the instructions for beyond the sword. Can someone please show me where they are?
 
I can't find the instructions for beyond the sword. Can someone please show me where they are?

As already mentioned you should follow the same instructions. The only difference is that you should use a modified Makefile. There is more than one along the thread. I attached one to this post: http://forums.civfanatics.com/showpost.php?p=6731340&postcount=89

It is the same file by Chazcon except for one extra source file added to the compilation and link process.
 
Top Bottom