Installing and using the SDK

It seems to have created the dll. My C++ is about limited the snippet below. :)

I don't even know how to do something as basic as this in civ4. Is there a quick 'n' dirty way of putting in a pop up text message so that i can make a test mod to see if it's working?

Is there a simpler freeware compiler for a win32 machine than codeblocks? Just to learn c++ basics? I was using the file test.c below as a test out of my knowledge and i failed miserably; couldn't figure out how to use codeblocks as a straight compiler rather than looking for a project etc.

Spoiler :
Code:
#include <iostream.h>

main()
{
    cout << "Hello World!";
    return 0;
}
 
scrap that, "hello world" is working, extension is cpp (c plus plus mebbe?)
ruddy windows command prompt can't handle filenames with spaces (*grumble*) hope vista is better or at least less bad.
 
All the shells I know (bash/sh and windows cmd) require names with spaces to be "quoted like this". If the command prompt is too annoying, install cygwin, which gives you a linux command prompt and tools under windows.
 
As far as i know, XP command prompt doesn't accept that? Ah i see, but CMD does. Interesting. My work computer has CMD disabled so i had never noticed it. Always just used COMMAND and improvised batch files to get to the right directory.

Spoiler :
Code:
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.

C:\DOCUME~1\BRETTC~1>dir
 Volume in drive C has no label.
 Volume Serial Number is 1487-FB45

 Directory of C:\DOCUME~1\BRETTC~1

26/03/2006  05:45 PM    <DIR>          .
26/03/2006  05:45 PM    <DIR>          ..
24/09/2006  04:30 AM         3,145,728 NTUSER.DAT
24/09/2006  04:59 AM            65,536 NtUser.dat.LOG
20/03/2006  07:54 PM    <DIR>          Start Menu
26/03/2006  05:45 PM    <DIR>          My Documents
26/03/2006  05:45 PM    <DIR>          Favorites
20/03/2006  07:54 PM    <DIR>          Desktop
13/09/2006  01:56 PM    <DIR>          .gimp-2.2
23/09/2006  12:54 AM                 0 .gtk-bookmarks
13/09/2006  01:56 PM           130,065 .fonts.cache-1
13/09/2006  06:44 PM    <DIR>          .thumbnails
22/09/2006  04:26 AM    <DIR>          .CodeBlocks
23/09/2006  07:37 PM               357 .cb_layout.bin
               5 File(s)      3,341,686 bytes
               9 Dir(s)   1,741,774,848 bytes free

C:\DOCUME~1\BRETTC~1>cd "my documents"
Parameter format not correct -  "my

C:\DOCUME~1\BRETTC~1>cd "My Documents"
Parameter format not correct -  "My

C:\DOCUME~1\BRETTC~1>

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Brett Caton>dir
 Volume in drive C has no label.
 Volume Serial Number is 1487-FB45

 Directory of C:\Documents and Settings\Brett Caton

26/03/2006  05:45 PM    <DIR>          .
26/03/2006  05:45 PM    <DIR>          ..
24/09/2006  04:30 AM         3,145,728 NTUSER.DAT
24/09/2006  05:02 AM            69,632 NtUser.dat.LOG
20/03/2006  07:54 PM    <DIR>          Start Menu
26/03/2006  05:45 PM    <DIR>          My Documents
26/03/2006  05:45 PM    <DIR>          Favorites
20/03/2006  07:54 PM    <DIR>          Desktop
13/09/2006  01:56 PM    <DIR>          .gimp-2.2
23/09/2006  12:54 AM                 0 .gtk-bookmarks
13/09/2006  01:56 PM           130,065 .fonts.cache-1
13/09/2006  06:44 PM    <DIR>          .thumbnails
22/09/2006  04:26 AM    <DIR>          .CodeBlocks
23/09/2006  07:37 PM               357 .cb_layout.bin
               5 File(s)      3,345,782 bytes
               9 Dir(s)   1,748,385,792 bytes free

C:\Documents and Settings\Brett Caton>cd "My Documents"

C:\Documents and Settings\Brett Caton\My Documents>
 
Oh my, haven't used command in years. CMD is almost a halfway decent prompt, but command (shudder), it needed doskey to have a history. If you use command, I guess you are stuck using mydocu~1 as what you cd to.
 
I'm getting this error when I'm trying to build the CvGameCoreDLL.dll file:

Code:
Project   : CvGameCoreDLL
Compiler  : Microsoft Visual C++ Toolkit 2003 (using GNU "make")
Directory : D:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Execution of 'mingw32-make.exe -f C:\DOCUME~1\Grave\LOCALS~1\Temp\cbm81.tmp Final Release' in 'D:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL' failed.

What am I doing wrong? :confused:
 
You configured Code::Blocks to at least partly use mingw (gcc/make) rather than MS VC++ 2003. Did you select the wrong thing at step 5?
 
talchas said:
You configured Code::Blocks to at least partly use mingw (gcc/make) rather than MS VC++ 2003. Did you select the wrong thing at step 5?

Hmmm... I don't think I did... but lemme check...


** EDIT **

No... MS VC++ 2003 is the default compilier. When I go to Settings-->Compiler, where at the top is says "Selected Compiler", MS VC++ 2003 is selected. When I scroll through the drop-down menu, if I highlight over another compiler, the "Set as Default" button unshades, but when I highlight MS VC++, the "Set as Default" button shades.

That means MS VC++ 2003 is the default compiler, right?
 
I think so, but I'm not running windows right now, so I'm not entirely sure. The thing is, it says its using MSVC++ 2003, but that its also using GNU make, which it shouldn't. Maybe try reinstalling code::blocks and remaking the project. Thats the only thing I can think of off hand.
 
Ok... I think I figured it out.

In the Settings--->Compiler, if I go to the "Other" tab, under "Build Method" there are two options: "Work with MakeFiles" and "Invoke Compiler Directly".

It was set to "Work with MakeFiles"... so I switched it to "Invoke Compiler Directly". and it worked. It started compiling...

But now I got this error while compiling:

Code:
Project   : CvGameCoreDLL
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : D:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvArea.cpp
d:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\CvInfos.h(35) : error C2059: syntax error : '--'
d:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\CvInfos.h(36) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
d:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\CvInfos.h(39) : error C2760: syntax error : expected '{' not ';'
d:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\CvInfos.h(41) : error C2144: syntax error : 'int' should be preceded by '}'
d:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\CvInfos.h(4973) : warning C4624: 'CvGameText' : destructor could not be generated because a base class destructor is inaccessible
Process terminated with status 1 (0 minutes, 8 seconds)
4 errors, 1 warnings

NOW what am I doing wrong? Looking at this... it seems like the default C++ files are corrupt? I never even messed with them! :confused:

I do have a few questions though:

1) This project seems to automatically include all the C++ files from the SDK directory. Do I just add the C++ files I modified into the project, and if so... do they overwrite the default C++ files?

2) Does it matter where I place the export DLL file? I didn't want to put it into a MOD/Assets directory or anywhere near the default files, because I didn't want to overwrite anything.
 
GraveEatr said:
But now I got this error while compiling:
Not sure whats wrong here.
NOW what am I doing wrong? Looking at this... it seems like the default C++ files are corrupt? I never even messed with them! :confused:

I do have a few questions though:

1) This project seems to automatically include all the C++ files from the SDK directory. Do I just add the C++ files I modified into the project, and if so... do they overwrite the default C++ files?
If you mean modified versions of the SDK files, then you should be working on a copy of the SDK, and then you can just overwrite the unmodified files. If you are adding completely new cpp or header files, then just stick them in the same folder and add them to the project.
2) Does it matter where I place the export DLL file? I didn't want to put it into a MOD/Assets directory or anywhere near the default files, because I didn't want to overwrite anything.
If you want the exported DLL to do anything, you have to put it under Mods/MOD_NAME/Assets, if you are just testing the compiler, stick it wherever you want.
 
talchas said:
Not sure whats wrong here.

I figured it out. For some reason the default CvInfos.cpp from the Warlords CD was messed up, and giving me those errors. I fixed the file, and all seems to be compiling well.

talchas said:
If you want the exported DLL to do anything, you have to put it under Mods/MOD_NAME/Assets, if you are just testing the compiler, stick it wherever you want.

Yeah, right now I'm just testing the compiler, just to get a feel for it.

Copying all the SDK files and putting them into the MOD folder does seem like a good idea. Like you said, then all the files are there, and ready to compile.

Thanks for the help, I think I may have it now. :king:
 
Hi everybody. I'm new at this forum. :goodjob:

I've read something about, and I would answer to you:

Is there a kind of this editor for Mac? :confused:

Thanks
 
Turin Civ-User said:
Hi everybody. I'm new at this forum. :goodjob:

I've read something about, and I would answer to you:

Is there a kind of this editor for Mac? :confused:

Thanks

I dont believe Mac's can use a modified dll. So even though Im sure there is a way to build the DLL with a Mac, I doubt you could use it.
 
Kael said:
I dont believe Mac's can use a modified dll. So even though Im sure there is a way to build the DLL with a Mac, I doubt you could use it.

So should I think there's no way for to build a mod on my Mac? :sad:

I remember that in Civ3 there was an official editor that makes me doing my own mods. Nothing of this for Civ4?
 
Oh, you can still do python and xml modifications, you just can't modify the DLL.
 
I am trying to compile the Warlords source using VC++ 2005 Express but using the VC++ 2003 toolkit & SDK. It is managing to compile everything without any problems except I get this error:
Code:
d:\my documents\civ 4 modding\warlords\cvgamecoredll\boost-1.32.0\include\boost\python\data_members.hpp(277) : error C2665: 'boost::python::detail::make_getter' : none of the 3 overloads could convert all the argument types

I have tried compiling using Code::Blocks but every file gives these warnings:
Code:
cl : Command line warning D4002 : ignoring unknown option '/O0'
cl : Command line warning D4024 : unrecognized source file type 'EHsc', object file assumed
cl : Command line warning D4027 : source file 'EHsc' ignored

I would appreciate some help as I am unable to find any info on differences for compiling the Warlords source.

[EDIT] I managed to get Code::Blocks to compile, but I would prefer to get VC++ working as it is faster and various things with Code::Blocks annoy me.
 
Hi. Until recently my copy of codeblocks has been working fine. However, since I upgraded to my new computer, I am getting the following error message whenever I try and compile my CvCity file

Code:
\CvGameCoreDll.h  15  fatal error C1083: Cannot Open File: "Windows.h": No Such file or Directory.

Can anyone tell me whats going wrong, and how to solve the problem?

Thanks in advance.

Aussie_Lurker.
 
I think you need to reinstall the platform SDK - windows.h is one of the core files for windows C/C++ programming.
 
Back
Top Bottom