Compiling SDK, help needed

Anon Zytose

Time Traveler
Joined
Apr 18, 2006
Messages
141
I'm not sure if posting a thread here will work, but I suppose it's worth a try.

Anyway, in a great hope at finally editing whatever of Civ4 I may choose without having to ask others to do so for me, I decided to try (yet again) to compile the SDK. The instructions I've tried to follow are here. I got as far as the last step and everything seemed to have been working well until I got the following message:
fatal error LINK1104: cannot open file '..\Assets\CvGameCoreDLL.dll'
Is there anyone out there willing to help me get around this error? And if so, thanks. ^^
 
Just to make sure, CvGameCoreDLL.dll is not set to read only is it? (Don't forget to make a backup if you're overwriting the original!)
 
Thanks, snarko. ^^

Well, shortly an hour after posting the request, I found that in the thread about compiling the SDK, other people had been posting solutions to problems like mine. (Should I move further requests about this there?) One person mentioned a problem that sounded like it was exactly like mine, and was given an answer of making that file no longer read-only. So I tried that and tried compiling the file again. I was given three other files named CvCameCoreDLL.exp, CvCameCoreDLL.lib, and CvCameCoreDLL.pdb. And I can't seem to figure out how to use any of them. Nowadays, when I try to compile the original file, it says there's nothing to do and stops.

I was a bit concerned when you mentioned to make a backup of the original file before writing over it. Fortunately, when accessing the game, it looks like it still works as it has been, so I decided I'd make a backup of the file right after closing out. In any case, thanks for reminding me about that. ^^;

I guess now I'm wondering what I need to do next. Have I now finally compiled the file? If not, then what remains to be done? And if so, then how do I edit the file?

I'm also starting to guess that I'll need to redo a lot of those steps for the BTS version of CvGameCoreDLL.dll...
 
You can ignore the .exp, .lib and .pdb files. They're used for building the DLL but the game doesn't use them (codeblocks does). Check the last modified date on CvGameCoreDLL.dll. It should be the time you compiled it. If not something went wrong. If it is, then there's nothing to do - you're done. (Except ofcourse all the coding ;))

You don't edit the DLL. You edit the .cpp and .h files (in codeblocks, or really any text editor). Then, when you're done coding, you compile it again.

You could've done it for BtS only, unless you plan on playing both versions of the game :p
When you do it again for BtS there's one more thing you need to do before compiling: remove the files CvGameCoreDLL.rc and resource.h from the project. They'll cause problems in codeblocks but fortunently aren't needed.
 
Another year (or at least season), another spotty attempt toward compiling the SDK once and for all.

Since March, my harddrive got screwy and I ultimately had to start over and reinstall everything. Considering I never managed to produce an SDK compiler the first time around, I wouldn't say I lost a whole lot. Still, only today have I gotten around to reclaiming all those programs I need.

Again, I followed the steps here, at least as closely as I could, anyway. For all the Final Release options and selections, the closest possibility said, "Final Release Win32". Also, "Produce debugging symbols [/Zi]" was already unchecked. It may help to note I found myself with CodeBlocks 8.02.

Now, I get the error:
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\CvGameCoreDLL' failed.
Nothing to be done.
I don't know how to get around this.

The .dll file is not read-only.

*hopes someone will respond with some help... please?* ^^;;
 
IIRC you also have to remove CvGameCoreDLL.rc from your project.

FYI, i also have have 8.02 and while the interface different than in the step-by-step guide, it is possible to build the SDK with it.
 
Well, I finally tried removing that file. I got the following message as a result.
=== CvGameCoreDLL, Debug Win32 ===
fatal error C1067: compiler limit : debug information module size exceeded
=== Build finished: 1 errors, 0 warnings ===
The error was at c:\Program Files\Microsoft Visual C++ Toolkit 2003\include\memory, at line 498. I also noticed that there were many warnings toward many of the files, although I wasn't able to catch which ones or of what nature. I think a lot of the Cv ones were warned about.
 
Oh, in 8.02, the /Zi flag is not set on the Compile Flags tag, but on the Other Options tab. Remove it from there. There should just be /EHsc on that tab.
 
Bubblewrap,

What size dll does 8.02 compile to? Above or below 5 megs?
 
By changing nothing but the basic things mentioned in the step by step guide and in this thread, it compiles to about 6.7mb, iirc that's about the same as the older Codeblocks version.

But to be nitpickish, it's not Codeblocks that compiles it, but the VS2003 compiler. Codeblocks only specifies which options to use and that doesn't just change between versions. Only way to get it the same size as the unmodded dll would be to use the exact same compiler options as the original.
 
Top Bottom