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

Well, I'm confident you'll succeed.
Myself, I will prefer to build up a team but, before, I must show that my ideas are of some interests. I'm still struggling to improve my graphic skills in various departments. I just wanted to be the first to ask you for help.
Maybe you'll be willing to write code for me at some point in exchange of ... well ... XML or graphic manpower.
 
CaptainMidnight,

What makefile are you using? My guess is that the call to "nmake Final_Release" is failing because you don't have a makefile that defines what goes into making Final_Release and so it thinks it's a file instead of a set of instructions. There are a couple makefiles in this thread that should at least give you a good starting point. Hope that helps.
 
Great help in setting things up, and kudos to the two people who updated the makefile for BtS! :goodjob: Also many thanks to the gent. who found the rm.exe for windows :goodjob:

One thing I would say (or ask), is that the "Ctrl-A" add all thingy is a bit misleading, as you aren't really adding the Boost and Python directories (and what's in them) to the project, or at least it doesn't appear that way to me. Granted, I haven't messed around with this stuff at all yet other than doing this initial setup, but it seems that step could be confusing.

The dll isn't built from the stuff in those directories, just the stuff in the "top" level CvGameCoreDLL directory, and that's all that really gets added to the project.

One last comment, while removing the Debug build option is fine for those who are new to coding and really aren't sure how to set all this stuff up, it isn't necessary to do (and perhaps actually should be avoided if you wanted to set up a debug build style using the makefiles provided by the posters here). May want to look into editing that part ;)

All in all, a GREAT help, thanks!
 
When I tried to compile it came up with this:
Spoiler :

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1052: file 'Final_Release' not found
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
Build log was saved at "file://d:\Documents and Settings\Thomas\Desktop\SDKmod\CvGameCoreDLL\Final_Release\BuildLog.htm"
CvGameCoreDLL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Obviously the version I'm using is 8.00.50727.42.

Another thing, I didn't follow steps 1-8 of this thread. I didn't think I needed to as I have a copy of the software 'out of the box'.

I'm using the BTS source code and have the lastest patch installed.

Any comments, advice or aloof mockery would be greatly appreciated.
When you say you have the software 'out of the box' you are referring to the 2003 Toolkit and the Platform SDK, or are you referring to the CIV SDK?

In any case, I would suggest following the steps, especially 1, 3, and 5-11. The other two you can obviously skip if you already have that software.

Also relevant is if you are building for regular 'vanilla' or Warlords or BtS? Your makefile will be different for BtS than the other two.
 
I'm writing for a different game right now but nearly done, and getting the Civ bug again. I have my copy of BtS installed but haven't launched a game of Civ in well over a year, heh. First thing I'll do is to update this for BtS. Stay tuned.
 
Déja;5842429 said:
I love that I posted about this exact method (along with a rudimentary makefile, http://forums.civfanatics.com/showthread.php?t=189651) nearly two full months before this thread was started, but that my name is consipcuously absent from the credits.

Much obliged, gents. Much obliged, indeed.

Chazcon did mention that this was based on Kael/DaveMcW's post (Apr 13, 2006) and my post (Jun 15, 2006), both of which were before your post (Oct 17, 2006). :)
 
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
 
One question: Has anyone tried using Microsoft Visual Studio 2008 with the SDK? I wonder if Microsoft learned the folly of their ways when they broke compatibilty with the release of Visual Studio 2005...perhaps 2008 is now backwards compatible?

I doubt it. If VS2005 doesn't work with VS2003 projects, then I bet VS2008 won't either. In any case, the method being used here is centered around a makefile. And makefiles are a pretty well supported standard across different compilers/IDEs, so I'm very sure VS2008 won't break makefile support. So although installation may be a little different, this makefile method should definitely work on VS2008, whenever it comes out.
 
I have been able to compile a working dll, but for some reason my computer says it's 4.63M, rather than 4.64M like the original for Bts. I know that when I originally add the files from CvGameCoreDLL to the project there is one hidden file. What is that? I have been having some problems modding, and i was wondering whether this could affect anything.

Thanks in advance.
 
Déja;5843069 said:
In case you haven't done it yet, I've attached an updated makefile that is tailored for BTS (3.03) and which now uses the toolkit 2003 and platform sdk.

All of the dependencies should still be current.

Déja, thanks for posting your makefile. In trying to use it though, I get an immediate error on the first build request:

Building Precompiled Header
cl /O2 /G7 /D "NDEBUG" /D "FINAL_RELEASE" /MD /GR /Fp"Final/CvGameCoreDLL.pch" /Fo"Final/" /Fd"Final/vc70.pdb" /Zi /I "Boost-1.32.0\include" /I "Python24\include" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "CVGAMECOREDLL_EXPORTS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /Yc"CvGameCoreDLL.h" /W3 /nologo /c /Gd /TP _precompile.cpp
_precompile.cpp
c1xx : fatal error C1083: Cannot open compiler intermediate file: 'Final/CvGameCoreDLL.pch': No such file or directory
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

[edit] I know why this happened now -- I did not create a "Final" directory before starting the build. The makefile should really do this for you, but it's a simple thing to fix manually. My other questions below still stand. [/edit]

I have a few questions/observations after reviewing the makefile in more detail.

(1) I think that your definition for macro PCHOPTS needs to be part of the !IF DEFINED(DEBUGBUILD)/!ELSE/!ENDIF construction so that the "/Fp" compiler option that names the output .pch file is in the right directory (Final/ or Debug/ as appropriate).

(2) You define macro PCHOPTS and then don't use it to create the .pch file.

(3) Doesn't the definition of the PCH macro need to be the same as the "/Fp" directory and name that will be used (i.e., "Final/CvGameCoreDLL.pch" or "Debug/CvGameCoreDLL.pch" as appropriate, and not "$(OUTDIR)_precompile.obj"? Wouldn't that also mean that PCH should also be defined in the !IF/!ELSE/!ENDIF construct?

[edit] $(OUTDIR)_precompile.obj target is needed, must be linked with DLL or link fails. So, we need BOTH _precompile.obj AND CvGameCoreDLL.pch as targets, one for the link and the other for the compiles. [/edit]

(4) You define $(PCH) as a target, but you also have a definition earlier in the makefile for a target "$(OUTDIR)_precompile.obj". Is the first definition even necessary?

(5) Doesn't the !IF DEFINED(DEBUGBUILD)/!ELSE/!ENDIF construction need to be at the top of the makefile so the $(OUTDIR) references are properly resolved? Which would also mean moving the definitions of the CPPGLAGS and LINKFLAGS macros to the front as well, right?

My makefile skills are rusty, but I just don't see how your definitions can work as currently coded. If I'm missing something, please explain.

Thanks again for what I am sure can be a really good makefile for us to work with.

Regards,

smacfan
 
Déja;5843069 said:
In case you haven't done it yet, I've attached an updated makefile that is tailored for BTS (3.03) and which now uses the toolkit 2003 and platform sdk.

All of the dependencies should still be current.

Part two. There are three non-existent dependencies listed in this makefile:

(1) For CvGlobal.obj and CvPlayer.obj, there are no files named NetworkState.cpp or NetworkState.h. I deleted those dependencies.

(2) For the .obj's with dependencies on CyPlayerInterface2.h, there is no such header file. Deleted that dependency wherever it existed.

I have actually been able to build a "Final" release DLL for BTS 3.13 (official), but have not yet tested it. I will make a few more tweaks to Déja's makefile and repost it when I have an at-least-minimally-tested DLL to report.

More as it happens.

smacfan
 
I've been having some problems compiling a working dll for BtS v3.13. This is probably the problem. Thanks, will be waiting for the new makefile.
 
I've been having some problems compiling a working dll for BtS v3.13. This is probably the problem. Thanks, will be waiting for the new makefile.

Have you been using Déja's makefile.vs8 or the one referenced in Chazcon's original post? I have seen others report success building with the one from Chazcon's post, though I dislike that makefile because it repeats all of the cpp files 5 times, once for each build target and directory, and does not take advantage of precompiled headers or the MSVC batch compile capability for compile speed. That's a high-maintenance makefile, IMHO.

smacfan
 
I don't know to much about SDK coding, but I think there's more to my problem than just the makefile. I can get it to compile, but it 1 is .01MB smaller than the original, and 2 will compile but won't load Civ with even the simplest changes. You can also look at my previous post #69.
 
I have actually been able to build a "Final" release DLL for BTS 3.13 (official), and have minimally tested it. I was able to start up BTS and load a saved game. I did not try to play a turn, no time for that tonight.

The resulting DLL is a bit smaller than the official BTS 3.13 patch DLL (4732 KB for mine, 4758 KB for the official 3.13). No idea why, but so far it does not seem to hurt.

I dynamically generated the list of dependencies for each of the *.cpp files into an external file, which I have named CvGame.dep, which is then brought into the makefile with !INCLUDE. I used the Cygwin version of the "makedepend" utility to do this. If you don't have Cygwin installed, just use the one I have attached below.

If you do have Cygwin and you add a *.cpp file or modify a *.cpp file to #include a new *.h file, you can recreate the CvGame.dep file by running:

nmake -f makefile.vsx depend

in a VC++ 2005 Command Prompt window while you are inthe CvGameCoreDLL directory (where all the *.cpp and *.h files live).

After you download the two files, rename them to "makefile.vsx" and "CvGame.dep" to use them. Read the comments at the beginning of "makefile.vsx" for usage instructions.

Thanks to Déja for a good base makefile with which to start.

My next test will be overlaying the official BTS 3.13 files with Bhruic's patched programs and headers and trying to duplicate his DLL.

More as it happens.

smacfan
 

Attachments

  • makefile.vsx.txt
    11 KB · Views: 169
  • CvGame.dep.txt
    94.8 KB · Views: 151
When I get back I will upgrade this to work with VS C++ 2008.
 
I don't think the difference in dll size matters. Probably due to different compilation and linker flags related to optimization.
 
I seem not to be able to Install the Platform SDK - the installer tries to connect to something, then timing out with "installation package not found"-message or something... I guess MS shut down the old version ? Any suggestions ?

[EDIT] Found another download from MS directly. Seems it has to be Validated now, so i guess the file linked above did not work as it was not validated/validated by someone else...
Does not work anyway, because "Can Not Access Network Ressource... Whatever" - during components download - but this is not related to this thread i think.
Somehow i get the feeling this will be too much hassle for the couple of changes i want to do...

Would it be possible to compile using the 2003 Toolkit only ?
Because i seem not to be able to get the Platform SDK and the 2005 Express thingie to work :(

[EDIT AGAIN] I got id downloaded/installed. It seems the "Internet Installer" is broken, but downloading the full archive works... (After validating that i just have validated my copy windows to validate that i really want to download those files [pissed])....

Trying around now... Is it normal that it throws tons of warnings at me ?! I think most are junk ("Function or variable might be unsafe")... But i seen a couple of "undeclared identifier" ones as well... does not sound good :(
 
Ok i sorted out the above stuff... (Had a typo in the path to the Platform SDK - become apprent once the compilation bailed out)...

However now i get a linker error:

cannot open input file 'odbc32.lib'

I did a search, ant such a file seems indeed not to be present... So... Where is it supposed to be ? Part of the 2003 Toolkit ? Or with the Platform SDK ?

[EDIT] Reinstalled Platform SDK, the file magically appeared...
Got a dll built now... On to testing...
 
Top Bottom