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

Don't know what the fix is, but I can translate a bit:

In FAssert.cpp, there are a couple of lines referencing functions defined in other files. The compiler compiles FAssert.obj just fine, but the linker can't locate them to make the appropriate connection. The unlocateable function names are:

DisplayAssertDialog
DialogBoxIndirectParamA
SetWindowTextA
EndDialog
SetFocus
GetDlgItem

These seem like things for bringing up the assert window. One of the lines making this reference is:

Code:
::SetFocus( ::GetDlgItem(hDlg, IDC_DEBUG) );

This is the only reference to SetFocus in the whole (BTS) SDK, so this function must be defined else where ... my bet is these functions are standard Windows popup functions and you're missing a debug DLL of some kind which needs to be bundled in while building. That's a bit of a guess though.

Also, I don't know what the :: in the code does when there's nothing to the left of it, anyone got some insight?
 
What target are you calling for a debug build ?

For short - most makefiles i have seen do have 4 different targets, that are just artifacts from the original Firaxis project (I guess some auto tool is used to generate these from the vcproject file). None of them, with the exception of "Final_Release" is usually working. I.e. the builds that have no "Final_" prefix (just "Release" & "Debug") seem to require additional/altered source files and libraries - probably for more verbose error reporting - i don't really know.

What it boils down to, is that the Debug config in my makefile is an somewhat odd mix from Final_Release and Final_Debug setings, needed to work around a pecularity of the free compiler (The limit on the debug symbol table size and the inability of the .exe to connect with the .dll if some debug libraries are linked).

You would need to reproduce the compiler and linker settings from my makefile, while using the intermediate targets and dependancies lists from a warlords makefile. Note, that for the Debug build, different compiler settings (Debug_SAFE_CFLAGS) are used for a few files (Namely the files that give you the "Symbol Table Size" error. For example: CyGameInterface.cpp, CyGlobalContextInterface#.cpp, CyMapInterface.cpp... I don't remember all of them out of my head, but you can look up in the makefile, or just act when encountering the said error).

If you point me to a WL makefile for the most recent version, i might be able to mash it up for you, however, i do unfortunately not have a recent copy of the Warlods SDK to try it myself (skipped WL whne installing the last time), so it would be some guesswork there.
 
It actually created a 9236k CvGameCoreDLL.dll! This time I started with your BtS Makefile (that comes with the pdf) and deleted all references to CvGameInterface and CyPlayerInterface2, and it worked (compiled at least :crazyeye:)!!!!!

I copied over the new dll and the pdb into mods\rfre.beta1p6\assets, and next it couldn't find boost_python-vc71-mt-gd-1_32.dll so that was copied from the SDK to the Warlords dir, and now msvcp71d.dll can't be found... well that's enough for 1 day.
 
Hi there
All over the sdk you get these types of variable declarations:
int iSearchRange;
int iPathTurns;
int iValue;
int iBestValue;
int iDX, iDY;

That's fine because the compiler assumes zero, but in VC2008 debugging you get superious variable watch data (often deceptively close to the real thing), unless you initialise these variables to zero for example:
int iValue = 0;

Why, I do not know and worse I do not know whether that is general to all debuggers or just VC2008. Debuggers are complicated beasts I'm sure! I just lost over 1/2 an hour trying to work out why my iValue was wrong. :crazyeye:
Cheers.
 
I would like to know how to modify the downloaded make file that comes with refar's instructions to suit BTS 3.13, because I need to make a Chinese 3.13 version of HoTK mod. If anyone could point me to the correct direction? Thanks a lot!
 
@Stmartin
In the absense of any other help for you, I think BTS 313 is almost the same as BTS 317 except there is one less file. If you compile your BTS 313 with the 317 makefile supplied by Refar, the compiler might complain and tell you about what file doesn't exist.

Once you know what that file is, delete all references to it in the 317 makefile and you should be good to go....I think. Those references are in a few places and include .obj references too.

Cheers.
 
@Stmartin
In the absense of any other help for you, I think BTS 313 is almost the same as BTS 317 except there is one less file. If you compile your BTS 313 with the 317 makefile supplied by Refar, the compiler might complain and tell you about what file doesn't exist.

Once you know what that file is, delete all references to it in the 317 makefile and you should be good to go....I think. Those references are in a few places and include .obj references too.

Cheers.

Thanks glider, I was so busy making the new release, and got late to reply. Thanks. I would try that. I also got code block as a last resort.

In fact, I still don't know what debugging is or how powerful it can be.:lol:
 
Hi there
All over the sdk you get these types of variable declarations:
int iSearchRange;
int iPathTurns;
int iValue;
int iBestValue;
int iDX, iDY;

That's fine because the compiler assumes zero, but in VC2008 debugging you get superious variable watch data (often deceptively close to the real thing), unless you initialise these variables to zero for example:
int iValue = 0;

Why, I do not know and worse I do not know whether that is general to all debuggers or just VC2008. Debuggers are complicated beasts I'm sure! I just lost over 1/2 an hour trying to work out why my iValue was wrong. :crazyeye:
Cheers.

Actually the C++ compiler doesn't assume anything. These are declared but not initialized variables and if you try to use them in code before being initialized you will get compile error when trying to compile the cpp file. For the debugger variables are addresses of memory locations where the value of a variable should be stored. All it does is to fetch the bytes at the specific address translate the bits value according to the variable type so it is an integer and not a float etc. and it displays whatever it gets into the watch window. Before initialization the memory location where the variable is stored contains garbage and that what the debugger displays.
 
I would like to know how to modify the downloaded make file that comes with refar's instructions to suit BTS 3.13, because I need to make a Chinese 3.13 version of HoTK mod. If anyone could point me to the correct direction? Thanks a lot!

Attached to the following post is a makefile that works with 3.13. It doesn't have Refar's enhancements but it works quite well for building Final_Release (not a debug DLL). I think you won't need debugging for the 3.13 release as if the 3.17 is ok the 3.13 should be ok as well.

http://forums.civfanatics.com/showpost.php?p=6731340&postcount=89
 
OK, so I built a default gamecore, worked fine. Went to start modding it, and now it wol't let me build a new one. Says "The Project cannot be created because another project already exists in the folder 'C:\...'

So I tried deleting and removing everything, cleaning if it was an option available from Microsoft Visual... but it still wol't let me build a new gamecore. And now I have no idea what happened to the original since I tried to remove it... So how do I remove my old project and start a new one? And how do I keep this from happening again?

I have all the original gamecore files and everything, I suppose I'll just start a new one in a new folder, but I'd like to remove this original project anyway, how do I go about doing this?

Edit: So yeah, was able to cook up a new gamecore, using a different directory name. But now I have two directory names that say they have projects in them, and wol't let me build new game cores from, and now they are deleted, and it still wol't let me use that path! How do I remove my old projects?
 
Will I find possible errors by using the debug DLL with XP? Or do I need to use Vista to find errors?

edit: need help. I cannot start my mod with the new debug DLL, it says: msvcp71d.dll is missing.

edit2: downloaded the file and put it in system32. still not working.

edit3: regsvr32 MSVCP71D.dll is not working either ("module not found")

edit4: copy the dll to D:\Spiele\Sid Meier's Civilization 4\Beyond the Sword did not help either :(
 
:goodjob: For what it's worth, this was the only thing I needed to add to Refar's pdf instructions (27.08.2008 v.2) to get debugging working for me. (I had the "can't find MSVCP71D.dll" error originally.) The other Makefile change Fagan noted didn't appear necessary in my case and I did not download any extra libraries beyond the ones listed in the PDF instructions.

My environment is:
IDE: Microsoft Visual C++ 2005 Express (set to run as Administrator)
Compiler: Microsoft Visual C++ Toolkit 2003
PSDK: Microsoft Platform SDK for Windows Server 2003 R2
OS: Vista Ultimate SP1 (32bit)
Civ: BTS 3.13 (Normally run 3.17 but I rolled back to check some stuff out)

I just wanted to add my two cents here and confirm that this worked for me, too. I just followed Refar's instructions to the letter and was able to compile both release and debug versions of the dll. The debug version gave me the MSVCP71D.dll not found error, so I tried changing the line in the makefile that Dresden refers to...worked! I'm hitting my breakpoints!

IDE: Microsoft Visual Studio C++ 2008 Express
Compiler: Microsoft Visual C++ Toolkit 2003
PSDK: Microsoft Platform SDK for Windows Server 2003 SP1
OS: XP SP3
Civ: BTS 3.17

Great job and many thanks to all of you frequent posters in this thread who have figured this all out! I stand in awe of your compiling greatness!
 
I always turn that one off by commenting the line out. Mainly just because I don't know what it means, and can't figure out the purpose for it. I would suspect that one of the programmers was concerned about certain files failing to load, so had placed it in there to run a test. Then he forgot to remove it before things were packed up for release to the publinc (hence being cryptic and useless)
 
This is a long thread and I haven't yet gone through it all, but none of the first posters seemed to have encountered this problem.

The instructions in the first post are for Warlords and I assume they haven't been updated because there's no change for BtS.

I copied the folder called "CvGameCoreDLL" right out of
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword

and put it in a new folder on the desktop "MyDLL" then followed the procedures (I had VC++ 2005 Express already.)

The first time I did this, I got an extra folder like CvGameCoreDLL\CvGameCoreDLL and when I got through it all to the last step where you build it said "0 Succeded, couldn't find makefile"

Deleted the whole folder and started over and got the screen in the attachment at the very start, saying there is a project there already.

EDIT: found a different makefile for 3.17 on page 7. I'll try that.
 

Attachments

  • SDKprep.jpg
    SDKprep.jpg
    179.4 KB · Views: 121
Yeah, I had the same problem, I couldn't figure it out, so just created a new folder (Just called it workingII, lol) to put the source code in and compiled that. Eventually I was able to use the original name again...
 
I need help with a debugging message I get. I run CIV with my debug dll, and then attach the process in VC 2008 express. I get an exception, which causes a CTD, and is repeatable. The code stops in CvCity.h, at this point (in bold):

Code:
#ifdef _USRDLL
	inline int getX_INLINE() const
	{
		return m_iX;
	}
#endif
	DllExport int getY() const;																			// Exposed to Python
#ifdef _USRDLL
	inline int getY_INLINE() const
	{
[B]		return m_iY;[/B]
	}
#endif

In the output window in VC, I get this message:

Code:
First-chance exception at 0x03cd873a (CvGameCoreDLL.dll) in Civ4BeyondSword.exe: 0xC0000005: Access violation reading location 0x00000010.
Unhandled exception at 0x03cd873a (CvGameCoreDLL.dll) in Civ4BeyondSword.exe: 0xC0000005: Access violation reading location 0x00000010.

If I hit Continue, the error simply repeats itself over and over, eventually stopping CIV entirely.

Can anyone shed some light on this crash? :confused:
 
Back
Top Bottom