Weird error when building a debug DLL

EDIT: Actually I'm using VC++2008 not VC++ 2003 or perhaps I missed something? Could you explain little more, I'm not too familiar with programming.

The problem could still be here.
I've one time tried to compile the unaltered 3.17 sourcecode with codeblocks, and it resulted in the same exception. With VC++ 2003 it worked.

At that time, google said, that the exception could be caused by values bigger than 8 bit or arrays bigger than 2000 slots.
 
I have added better BTS AI, ranged bombard and some my own adds (two promotion tags and a dawn of man fix).

Can you compile just BBAI? Just Ranged bombard? Just your own adds? If you break the problem down perhaps you can find the solution. Splitting big include files should be a last resort.
 
So lets pull things together. I tested your code Afforess and it compiled without errors. So it seems that there's something wrong with my mod. Does anyone have ideas what it might be? I compared the Afforess' code to mine and noticed that there isn't CvGameCoreDLL.rc file in my folder. Is that improtant for the basic code or addons of Afforess? I checked refar's quide::confused::confused:

My code compiled fine? I guess the solution is just to use my sources.... J/K.:lol:


Seriously though, compare my project setting with your own. If mine compiles, you have everything set up right, just a bad setting somewhere. Maybe your makefile is wrong, compare ours too.
 
I compared Afforess' sources and mine but couldn't find anything. The makefiles were also nearly the same. It's possible that I missed the problem though. Then I tried building a debug DLL with plain BTS source and got the same error message. :confused: :eek:
So it seems to me that there might be something wrong with my project. Any ideas how to try to find something?
 
You should be able to build the makefile from the command line. Run cmd.exe. Put the folder containing nmake.exe on your path. Go to the folder containing the makefile. Run "nmake Debug".
 
You should be able to build the makefile from the command line. Run cmd.exe. Put the folder containing nmake.exe on your path. Go to the folder containing the makefile. Run "nmake Debug".

Umm, sorry? What's cmd.exe and what path? I didn't understand what you meant. I'm terribly sorry, but I'm a big noob in this kind of things so could you be more precise?
 
By command-line I'm talking about what's called a "shell" which lets you type (yes type) commands for the shell to run. In this case the shell is "cmd.exe" which is the name of the program (just like Civ4BeyondSword.exe is a program) that you run to get the shell.

So do Start : Run... and type "cmd" without the quotes (the .exe is detected automatically) and hit ENTER. You should see a terminal window: text based screen with a command prompt such as "C:\>" which is where you enter shell commands.

I recommend doing a little reading on Wikipedia on the "command shell" for windows. You can type "help" to see a list of commands and "help <command>" for information on a command.

The system PATH is a variable that contains a list of folders that are searched for a program when you type a program name in the shell. If you type "nmake Debug", "nmake" is the name of the program (nmake.exe), and the shell will look in all of the folders in your path for a program called nmake.exe. You don't have it in your path normally since you installed the PSDK yourself, so you need to add it to your path.

Actually, you can reference it directly so let's skip the PATH part for now.

Where did you install the Windows PSDK? Mine went by default into "C:\Program Files\Microsoft Platform SDK". Inside it is a folder called "bin" which is typically where executable programs are stored.

First you need to set the "working directory" to wherever you have your makefile. In my case that's "C:\Coding\Civ\SDK\Dev\BULL\SDK". You use "cd" to "change directory" to that folder.

Code:
C:\>[B]cd C:\Coding\Civ\SDK\Dev\BULL\SDK[/B]

Now run the nmake command. Here quotes are required because the folder path has spaces in it.

Code:
C:\>[B]"C:\Program Files\Microsoft Platform SDK\bin\nmake.exe" Debug[/B]

Do that and you should see the same output that normally goes into the Output window in VS. This ensures that VS is out of the picture. Do you get the same errors?
 
Ok, I had to read your post seven times before I understood something. :D
I opened that cmd.exe and typed there that "change directory" thing. Then I typed there:
Code:
C:\>"C:\Program Files\Microsoft Platform SDK\bin\nmake.exe" Debug
But I guess I did something wrong.
attachment.php
 

Attachments

  • i did something wrong.jpg
    i did something wrong.jpg
    37.8 KB · Views: 205
Ah, you have your SDK on a different drive (D instead of C). No worries, just type "D:" and enter the nmake command again.

Windows is strange in that it has a "current directory" on each drive. You need to also tell it to switch drives.
 
Ah, you have your SDK on a different drive (D instead of C). No worries, just type "D:" and enter the nmake command again.

So I did do something wrong because I have the SDK on C.
First you need to set the "working directory" to wherever you have your makefile. In my case that's "C:\Coding\Civ\SDK\Dev\BULL\SDK". You use "cd" to "change directory" to that folder.

Code:
C:\>cd C:\Coding\Civ\SDK\Dev\BULL\SDK
Now run the nmake command. Here quotes are required because the folder path has spaces in it.

Code:
C:\>"C:\Program Files\Microsoft Platform SDK\bin\nmake.exe" Debug
I though I did exactly what you said here.
 
You are referring to nmake on C: (correct) using what's called a full path--from the drive letter through all directories to the file itself. So that's not the drive that matters here. You are "cd"ing to your SDK which is on D, and this is what matters. You need to "cd" and then "D:" to tell it to switch to that drive.

Then do the same nmake command you did above.

Code:
cd D:\CvGameCoreDLL
[B][COLOR="DarkOrange"]D:[/COLOR][/B]
C:\>"C:\Program Files\Microsoft Platform SDK\bin\nmake.exe" Debug
 
Ok I gave it another try, but I don't think I got it right this time either. Here's what i got:
attachment.php

Is there still something wrong what I did or is that actually the cause of error?
 

Attachments

  • another error.jpg
    another error.jpg
    72.7 KB · Views: 191
It looks like it's doing the right thing (paths are right, location of files), but it cannot find a header file it needs. Can you post your makefile please? Did you set up the paths to the include and library folders in your makefile?

Also, type "path" on the command-line and post a screenshot of the result.
 
Ok I typed to the command line the path
attachment.php

and also checked the makefile. I noticed one thing I'm not sure in the makefile.
Code:
### Variables used in this Makefile
TOOLKIT=C:/Program Files/Microsoft Visual C++ Toolkit 2003
[B]PSDK=[COLOR="Red"]C:/Program Files/Microsoft SDKs/Windows/v6.0A[/COLOR][/B]

# uncomment, if you want new dlls copied to your mod's Assets folder automatically
#YOURMOD=D:/Spiele/Civilization 4/Beyond the Sword/Mods/Culturally Linked Starts
it's Psdk so should it point the platform SDK something like this
Code:
C:\>"C:\Program Files\Microsoft Platform SDK\bin\nmake.exe" Debug
or is that ok?
 

Attachments

  • command line path.jpg
    command line path.jpg
    37.2 KB · Views: 183
  • Makefile.rar
    Makefile.rar
    5.8 KB · Views: 44
Change that line to this:

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

I tried building the debug DLL but got the same error again. I'll try to rebuild it to see if that changes something.

EDIT: Ok, I still get the same error message as before so that didn't help. Do you have any ideas what I do next?
 
sal.h (which is the cause of the error in the screen posted by NotSoGood) was missing in the v6.0A SDK. NotSoGood, check if C:\Program Files\Microsoft Platform SDKs\Windows\v6.0A\include\sal.h exists.
I checked it but I don't even have that windows folder in Microsoft Platform SDKs. :confused:
If not copy it from another SDK you have or maybe try the one found here

http://www.koders.com/c/fid9706722F528C03B8B9A7C8211A97E736A6E05667.aspx
I'm not sure I should copy just that file if i don't even have the entire folder. Is sal.h a file that's so common that you can find it somewhere else?
 
Back
Top Bottom