Ok I bet my problem and of some other is coming from some special setup.
So first what I'm using:
- XP Pro with SP3
- Civilization complete with the 3.17 patch applied.
- At this point I test it only with the BtS CoreGame dll, not yet with a mod (I wanted to be sure the mod wasn't involved in the problems, I advise do this too until you make it works once).
- About the service "Services Terminal Server" its setup is set to manual but something had launch it at some points, perhaps MVC.
I followed closely the pdf guide made by Refar. That adds to my computer:
- Microsoft Platform SDK
- Microsoft Visual C++ Toolkit 2003
- MVC2008 which installed: Microsoft Visual Studio 9.0
During its installation I checked 2 options but I remember only one relative to Database.
With the unmodified makefile provided by Refar:
- I succeed to build the Release. And the build dll working well.
- I also did a successful Debug build.
But when I was Running BtS with the debug dll:
- I got an error of a missing msvcp71d.dll. I found one on the net and put it in BtS folder.
- Then I got an error of a missing msvcr71d.dll. I found one on the net and put it in BtS folder.
- The I got a Python error, with Python messages activated in ini file it was saying that the load of CvGameInterface was unsuccessful.
Quote that at this point, it's not clear where MVC2008 could be involved as only SDK folders are involved and only MVC2003 commands are issued during builds.
I have multiple possible tracks at this point but I dig only one, the makefile.
So I did the following changes to the makefile:
1 - Changed boost_python-vc71-mt-gd-1_32.lib to boost_python-vc71-mt-1_32.lib in the line Debug_LIBS=
2 - Removed /D_DEBUG from the lines Debug_CFLAGS= and Debug_SAFE_CFLAGS=.
I join bellow a modified makefile that I'm using. The point 1 is definitely linked with the problem of *d.dll. And the point 2 is involved by the change of the point 1.
At this point I could use the debug dll with BtS and get no error. But for debugging I think it's not enough, I had also to do some setup in MVC2008 :
- Select the solution configuration "Debug" at the top (not Final_Release).
- Select the project, right click on it, select "Properties".
- Expand "Configuration properties" in the left.
- Select "Debugging"
- Then fill the fields on right as this:
- Command, it's the path to the application BtS: C:\Games\Civ4Complete\Beyond the Sword\Civ4BeyondSword.exe
- Command arguments, let it empty.
- Working directory, check your shortcut to BtS, with Civilization complete it's: C:\Games\Civ4Complete
- Attach: Yes
- Debugger type: Mixed
- Environment, let it empty.
- Merge Environment: Yes
(I know the snapshot is missing!) EDIT: I joined one bellow.
Once this setup is done:
- Backup the dll in the Assets folder in BtS.
- Copy the dll generated from the debug folder to the Assets folder in BtS, let here a copy of the files. It's not useful to also copy the pdb file, MVC2008 will be able to find it where it has generated it.
- Launch Bts (through windows or MVC2008) and start a game.
- In menu "Debug" select "Start Debugging"
- Open CvUnit.cpp and set a breakpoint in the method getExperience().
- Click next turn in the game and the game should stop and you should be in the breakpoint.
- If it works the red bullet of the breakpoint becomes an arrow and in bottom left you can inspect objects and variables.
Before to try the debugging be sure that the Release version of the dll is working fine. Also when you have generated the debug dll you can test it just by launching BtS without to attempt debugging, it should works.
So first what I'm using:
- XP Pro with SP3
- Civilization complete with the 3.17 patch applied.
- At this point I test it only with the BtS CoreGame dll, not yet with a mod (I wanted to be sure the mod wasn't involved in the problems, I advise do this too until you make it works once).
- About the service "Services Terminal Server" its setup is set to manual but something had launch it at some points, perhaps MVC.
I followed closely the pdf guide made by Refar. That adds to my computer:
- Microsoft Platform SDK
- Microsoft Visual C++ Toolkit 2003
- MVC2008 which installed: Microsoft Visual Studio 9.0
During its installation I checked 2 options but I remember only one relative to Database.
With the unmodified makefile provided by Refar:
- I succeed to build the Release. And the build dll working well.
- I also did a successful Debug build.
But when I was Running BtS with the debug dll:
- I got an error of a missing msvcp71d.dll. I found one on the net and put it in BtS folder.
- Then I got an error of a missing msvcr71d.dll. I found one on the net and put it in BtS folder.
- The I got a Python error, with Python messages activated in ini file it was saying that the load of CvGameInterface was unsuccessful.
Quote that at this point, it's not clear where MVC2008 could be involved as only SDK folders are involved and only MVC2003 commands are issued during builds.
I have multiple possible tracks at this point but I dig only one, the makefile.
So I did the following changes to the makefile:
1 - Changed boost_python-vc71-mt-gd-1_32.lib to boost_python-vc71-mt-1_32.lib in the line Debug_LIBS=
2 - Removed /D_DEBUG from the lines Debug_CFLAGS= and Debug_SAFE_CFLAGS=.
I join bellow a modified makefile that I'm using. The point 1 is definitely linked with the problem of *d.dll. And the point 2 is involved by the change of the point 1.
At this point I could use the debug dll with BtS and get no error. But for debugging I think it's not enough, I had also to do some setup in MVC2008 :
- Select the solution configuration "Debug" at the top (not Final_Release).
- Select the project, right click on it, select "Properties".
- Expand "Configuration properties" in the left.
- Select "Debugging"
- Then fill the fields on right as this:
- Command, it's the path to the application BtS: C:\Games\Civ4Complete\Beyond the Sword\Civ4BeyondSword.exe
- Command arguments, let it empty.
- Working directory, check your shortcut to BtS, with Civilization complete it's: C:\Games\Civ4Complete
- Attach: Yes
- Debugger type: Mixed
- Environment, let it empty.
- Merge Environment: Yes
(I know the snapshot is missing!) EDIT: I joined one bellow.
Once this setup is done:
- Backup the dll in the Assets folder in BtS.
- Copy the dll generated from the debug folder to the Assets folder in BtS, let here a copy of the files. It's not useful to also copy the pdb file, MVC2008 will be able to find it where it has generated it.
- Launch Bts (through windows or MVC2008) and start a game.
- In menu "Debug" select "Start Debugging"
- Open CvUnit.cpp and set a breakpoint in the method getExperience().
- Click next turn in the game and the game should stop and you should be in the breakpoint.
- If it works the red bullet of the breakpoint becomes an arrow and in bottom left you can inspect objects and variables.
Before to try the debugging be sure that the Release version of the dll is working fine. Also when you have generated the debug dll you can test it just by launching BtS without to attempt debugging, it should works.