View Full Version : [NEED HELP] SDK Compiling Error


Grave
Sep 30, 2006, 07:47 AM
I've got all the C++ files ready to be compiled, and am running into a problem. I followed Kael's directions (http://forums.civfanatics.com/showthread.php?t=166933) to a tee in his tutorial, but when I go to build the DLL file I get the following error:

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

Any idea what this means? :mad:

Lord Olleus
Sep 30, 2006, 09:22 AM
Its just a list of typos. The first one says that on line 25 you types -- instead of - (i premuse)
The second and third one means that you have missed a ; at the end of the line
The fourth one means that you haven't got your brackets right
The fith one means that you have done someting wierd with a CvGameTextObject.

Its all written there in english, just read them.

Grave
Sep 30, 2006, 09:43 AM
Yeah but the problem is these are the default (stock) C++ files... I didn't even mess with them.

I was trying an exercise in compiling... and tried to compile all the default C++ files that came with Warlords (located in Warlords/CvGameCoreDLL directory).

I wanted to see if I could compile the default C++ files before attempting to add my modified C++ files.

Déja
Sep 30, 2006, 10:29 AM
is this the vanilla or the warlords sdk?

PeteT
Sep 30, 2006, 02:06 PM
That's weird. This is what lines 34 to 40 of CvInfos.h should look like:


//---------------------------------------PUBLIC INTERFACE---------------------------------
public:

//constructor
DllExport CvInfoBase();
//destructor
DllExport virtual ~CvInfoBase();


How does that compare to what you've got?

Grave
Sep 30, 2006, 02:29 PM
How does that compare to what you've got?

This is my CvInfos.h, lines 34-41:

//---------------------------------------
---------------------------------
public:

//constructor
DllExport CvInfoBase();
//destructor
DllExport virtual ~CvInfoBase();

Déja
Sep 30, 2006, 02:34 PM
//---------------------------------------
---------------------------------


That's your problem, right there. Take out that line break (you can add in the PUBLIC INTERFACE if you want, but because the // represents a line comment and the second half of that ------ is not on the same line as the comment markers, it's not commented out and is being treated as though it were code. Needless to say, a series of -'s is not valid C++ code.

PeteT
Sep 30, 2006, 02:35 PM
It's that second dashed line. It's not falling within the scope of the comment delimiter "//" and so is causing syntax errors. You could just remove it.

edit: Sometimes you gotta be really fast around here. ;)

Déja
Sep 30, 2006, 02:40 PM
edit: Sometimes you gotta be really fast around here. ;)

:satan: muahahaha

Grave
Sep 30, 2006, 02:42 PM
Cool, thanks guys... I'll try it out.

You'd think the SDK files from Firaxis/2K that were installed straight from the Warlords CD would be error free!

Lord Olleus
Sep 30, 2006, 03:10 PM
They probably were. I guess that you accidently pressed [ENTER].

Grave
Sep 30, 2006, 03:27 PM
They probably were. I guess that you accidently pressed [ENTER].

Seriously, I didn't mess with them. They were still Read-Only when I first opened them to see what was wrong.