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

Oops, I copied the files from the regular Civ IV SDK directory instead of the BTS one. I realized this when actually looking through them...

So, yeah- if anyone happens to read this, I've fixed it and gotten a DLL to compile now.
 
Wouldn't it be so great and so simple if they would just port Civ 4 to VS 2008 or VS 2010?
 
They would have to port the entire program to a newer version, not just the DLL.

Let's all hope they do this in the next release, for our sake.

It is really not their fault, it is Microsoft, who has broken backwards compatibility.
 
Hello,

I wanted to try my hand at modding, but could not get the DLL to compile.

I'm getting lots of errors of the type:
CvCity.obj : error LNK2019: unresolved external symbol "public: void __thiscall CvEventReporter::cityHurry(class CvCity *,enum HurryTypes)" (?cityHurry@CvEventReporter@@QAEXPAVCvCity@@W4HurryTypes@@@Z) referenced in function "public: void __thiscall CvCity::hurry(enum HurryTypes)" (?hurry@CvCity@@QAEXW4HurryTypes@@@Z)

I think I've followed all the steps properly, but it won't build. I've attached the build log. Am I missing files or something? I'm using BTS 3.19, and I realize the steps here might be outdated.

Any help would be appreciated. Thanks!
 

Attachments

Before anyone answers my previous post, I discovered the makefile for 3.19. I'm trying it again. Hopefully it'll work now. *fingers crossed*
 
Hey Chazcon. I had been using Visual Studio 2008 to compile my 3.17 files, but now it doesn't seem to want to work with 3.19. I'm using the new makefile, so can you think of any other reason why it might have stopped working? Any help you can offer would be much appreciated, because I have an intriguing idea for a mod that I'd like to get started on!

Aussie.
 
Well as it happens I've also been trying Code:Blocks again recently-but I'm still getting the following error:

Code:
Execution of 'rc.exe /IBoost-1.32.0\include /IPython24\include  -fo"Final Release Win32\CvGameCoreDLL.res" CvGameCoreDLL.rc' in 'C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\True Prophets for BtS v3.19\CvGameCoreDLL' failed.

Does this like familiar to you &, if so, what's a likely solution?
In the meantime, I'll try compiling the SDK in Visual Studio again.

Aussie.

EDIT: Another weird thing in Code:Blocks is that it keeps creating a new \Beyond the Sword & \Assets folder *within* my Mod folder-its never done that before!!!
 
I removed all traces of the RC command from my makefile since it wasn't actually referenced. This meant deleting CvGameCoreDLL.rc as well as the RC command and the rc.exe targets in the makefile. I don't know how your rc.exe target is being kicked off, but you should remove it.
 
Well for Code::Blocks I'm not using a specific Makefile-just using the instructions as set out by Kael in his original tutorial. The RC file never caused any issues for me in Code::Blocks when I was using Warlords, but now....

Aussie.
 
Ok, so this is the message I get when I try and do a clean build-as you see it doesn't even start properly before it fails on me!

Code:
1>Performing Makefile project actions
1>Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1> "C:/Program Files (x86)/Microsoft Visual C++ Toolkit 2003/bin/cl.exe" /nologo  /MD /Gd /G7 /GR /O2 /W3 /EHsc /DWIN32 /DNDEBUG /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /DFINAL_RELEASE   /IBoost-1.32.0/include /IPython24/include /I"C:/Program Files (x86)/Microsoft Visual C++ Toolkit 2003/include" /I"C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" /c CvArea.cpp /FoFinal_Release/CvArea.obj
1>'C:/Program' is not recognized as an internal or external command,
1>operable program or batch file.
1>NMAKE : fatal error U1077: '"C:/Program Files (x86)/Microsoft Visual C++ Toolkit 2003/bin/cl.exe' : return code '0x1'
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:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\True Prophets for BtS v3.19\CvGameCoreDLL\Final_Release\BuildLog.htm"
1>CvGameCoreDLL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
'C:/Program' is not recognized as an internal or external command

This means that a command is being issued without correctly quoting a path that contains spaces ("program files"). In the makefile you'll see a line that defines a folder that contains a program:

Code:
PSDK=C:\Program Files\Microsoft Platform SDK

And later a line that uses this path. The line above must not have quotes, but the line that combines $(PSDK) with the rest of the path and the command must:

Code:
LINK="$(PSDK)\bin\ld.exe"

I'm not saying that the LINK line is it; that's just an example.
 
OK, at the risk of looking dumb-could this be the cause of the error?

Code:
#YOURMOD=C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\RevolutionDCM

Do I need to change this to my actual Mod Folder name? Refar never mentioned this little detail, & its not been an issue for me before but.....

Aussie.
 
OK, so I changed that & am now getting this error message:

Code:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Final_Release Win32 ------
1>Performing Makefile project actions
1>Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>NMAKE : fatal error U1052: file 'Final_Release' not found
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:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\True Prophets for BtS v3.19\CvGameCoreDLL\Final_Release\BuildLog.htm"
1>CvGameCoreDLL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any thoughts?

Aussie.

EDIT: Oh & I've attached a copy of the Makefile for you to look at. Thanks for this by the EF, you've come to my rescue so many times now :)!
 

Attachments

It sounds like it's not creating the Final_Release folder before starting the compile. I see that the makefile is creating the folder, and I would expect to see that error after a compile command was first issued. This must be something different. How exactly have you set this up now? VS 2008? Code::Blocks?

That line you posted in the previous post starts with a #. Everything after # is ignored as it's a comment.
 
With Glider's makefile and Refar's PDF I was able to successfully build and debug the 3.19 SDK DLL from Visual Studio 2008 on Windows 7 x64.

I was also able to set it up so that I can easily start debugging from within Visual Studio. First of all, I set up the makefile to copy the built DLL to the Bts Mods directory. However, you need administrative access to copy into that folder since it's under program files, so I think it normally wouldn't work. I moved the Mods folder to a location under My Documents, and then I used mklink /D to make a link from the Beyond the Sword directory under Program Files to the Mods folder under My Documents. So the makefile copies it to the folder under My Documents, and Beyond the Sword ends up reading from the same folder, even though it's accessed with a different path. Here is what the line in the makefile looks like that controls this:
YOURMOD=C:\Users\Daniel\Documents\civ4\Mods\TestMod

Then I wanted to set it up so I could just start the debugging from within Visual Studio. So I set BeyondTheSword.exe as the Debugging Command in the project properties. Then, to get it to load my mod automatically, I set the command arguments to "mod=TTestMod". The folder for my mod is actually just "TestMod", but Civ IV apparently has a bug where it ignores the first character after the "=" in this case, so I put the extra "T" in there.

Now I can simply press F5 from the project in Visual Studio to start debugging.

Note that I am using the professional version of VS2008, so it's possible that something here wouldn't be supported in the Express editions.
 
Back
Top Bottom