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

So now that we have a Rhye Makefile, can someone please compile it for me because on my computer it still says Final-Release not found.
 
So you have all the work done, you just can't compile? If so, I'll give it a try with codeblocks on sunday if you'll upload the source files into the playable Byzantines thread in my signature. Unfortunately, I won't be able to help until then.
 
"Houston, we have a problem!"
So, it compiles, it links, it works!! I've played a lot of games with my modded dll, and everything seemed allright.
Now, here comes a problem. A BIG problem, it seems. And I'm quite sure of that.
I use BTS 3.17.

In the method CvPlayerAI.AI_bonusTrade, there's this line
Code:
  eAttitude = AI_getAttitude(ePlayer);

This class has two methods with this name
Code:
AttitudeTypes CvPlayerAI::AI_getAttitude(int iAttitudeVal)
AttitudeTypes CvPlayerAI::AI_getAttitude(PlayerTypes ePlayer, bool bForced)

The call is obviously intended to execute the second method (with the default value of bForced to false). I've placed a couple of traces in the code (displaying messages) and I've noticed that instead it calls the FIRST method, giving a value of ePlayer=0 (the active player). So, instead of calculating the attitude against player 0, it converts the attitude value 0 in the corresponding attitudetypes, which is ATTITUDE_CAUTIOUS. As a result, every call always returns CAUTIOUS, regardless of the actual attitude.

I've never noticed this malfunction; the game seems to work correctly.
I could simply correct this (by adding a second parameter in the method call), but I'm afraid this can affect other parts of the code.
Is this a problem introduced with the 3.17 patch? Does anyone else have the same problem? Maybe, there could be a compiler option to set.
 
This is a known bug with BTS 3.17; for further discussion see RefuseAttitudeThresholds not working ???. The workaround that Dan suggests in that topic
Code:
eAttitude = (GET_PLAYER((PlayerTypes)getID())).AI_getAttitude( ePlayer);
seems to work and has been implemented in both Unofficial Patch 0.19.1 and BetterAI 0.36
 
"Houston, we have a problem!"

Yeah preciate you finding bugs in the code, however in the context of this forum, the "Houston we have a problem" issue is that a few of us can't even debug at all. What debugging setup are you using?

Cheers.
 
I made a final (so i hope) change to the makefile.

Cleaned it up, redefined targets, so it can make Final_Release and Debug builds now.
Also made clean work with del insted of rm, as i don't have rm at hand.
Included modified (only slightly) instructions from the first post with a few sceenshots as PDF.
On a sidenote - while i couldn't find a way to compile a single file from withgin the VS2005 IDE, you can invoke nmake from console (Tools->VS Command Prompt) to call for intermediate targets. nmake Debug\CvUnit.obj for example will compile CvUnit in the Debug context.

http://forums.civfanatics.com/downloads.php?do=file&id=10018

---
@Glider1 - the PSDK was about 400 MB i think.
Can't believe it, I just followed the instruction and used MVC++ 2008 Express instead of the 2005 and the compile worked at first try. :eek: Thanks all those who contribute and even more Refar for the final guide, the multiple snapshots are very helpful.
 
Thanks, glad to hear it helps.
 
Thanks, glad to hear it helps.
Cool, thanks again. :)

But to be more precise I have to add that when using the MVC 2008, the normal build runs fine with one warning. Debug build runs fine and no warning. The game (in fact it's a mod, the RtW Dale's mod) runs totally fine but as other people here using MVC 2008 the debug isn't working despite the game runs fine with the debug dll.

Ha well having the compilation working is already big. :D
 
It must be a problem with the 2008 debugger being unable to connect (or unable to interprete the debugging information)... I don't know how to fix this, other than using another, oleder debugger.
 
It's a little complicate. A first error I did was not using the dll generated in the debug directory. :D

When I realized this error, I felt upon error message requesting debug versions of 2 dll when I was using the debug dll just by launching normally the game/mod.

At this point I did thing I hate download dll from the net (welcome the virus!!) I end in downloading two debug dll in versions I found on most site. Those dll are :
msvcr71d.dll and msvcp71d.dll.

When launching the game with the debug dll I didn't get anymore dll missing error but during init a message saying the Python init failed.

After some search I quote that the standard dll (msvcr71.dll) in BtS folder hadn't the same version than the debug version of the dll I found on the net. I tried found a debug version of this dll with same version number. I failed but instead noticed two versions of this debug dll. Both had same version but not the same build date.

I exchange the dll to use the version I wasn't using which was an older build but same dll version. Surprise now the game launch with no error even with the debug dll.

I progress but now it's about linking the MVC with the dll in debug mode.

EDIT: Just a quote about those dll added, well not in the system folders, add them in the BtS folder is ok.
 
It must be a problem with the 2008 debugger being unable to connect (or unable to interprete the debugging information)... I don't know how to fix this, other than using another, oleder debugger.
When reading various post about debugging dll with MVC 2008 it seems there are problems relative to debug compilation option. A default option involving problems like I get ie to find debug version of some dll used. That said I found nothing I can understand about an alternate option more similar to what you are using with MVC 2005.
 
I read again the previous post to track those related to debug with MVC 2008 and it seems I don't have same problems. There's perhaps something I forget or it is coming from my system (xp pro).

At this point the builds debug and normal seem to run fine. Running the mod with the normal dll generated also works fine but when using the debug dll I have various errors depending of some other dll.

I had error messages saying me that xxxd.dll is missing but after have found some version of those dll and put them in BtS folder I get a new error message saying the python can't be initialized.

I suspect there's some build debug option to overcome the problems with the xxxd.dll but didn't found any post nor any article clear enough to give me a track. Anyway I'm not sure that if I found a way to not use the xxxd.dll that I will not have finally the error I have at this point about python init error.
 
This msvcprtd.dll is the debug dll and should not be used in the debug build (because it is known to cause these problems with python).

My makefile forces using/linking to the normal msvcprt in the debug build, so i am not sure why your system is asking for the **D.dll - it shouldnt be involved.

When trying to debug i can not run the game from within the ide - i must run the game externally (using the debug dll of course) and then attach the debugger to the already running civ4 process.
 
This msvcprtd.dll is the debug dll and should not be used in the debug build (because it is known to cause these problems with python).

My makefile forces using/linking to the normal msvcprt in the debug build, so i am not sure why your system is asking for the **D.dll - it shouldnt be involved.

When trying to debug i can not run the game from within the ide - i must run the game externally (using the debug dll of course) and then attach the debugger to the already running civ4 process.
Thanks a lot to try help. I'd like light some points:
I don't see where MVC2008 is involved :
- When I run the build only exe from MVC2003 are run.
- Then I take the dll and pdb files and moved them in the root of the folder Assets in the mod.
- Then I just run the application and that bastard :D is requiring some *d.dll.

In no way MVC2008 seems involved, that's so weird.

You mention you force use of msvcprt but how about msvcp71.dll and msvcr71.dll that are in the bin folder of MVC2003 and seems cause the problem?

Perhaps I should add something like :
/NODEFAULTLIB:msvcr71 /NODEFAULTLIB:msvcp71
?
 
This is really odd... Because it does not rant about any other libs for me....

I also do not remember reading something on the account of msvcr71 / msvcp71 so i am at loss here... What i do believe to know, is, if you force /NODEFAULTLIB:... you will probaly need to provide replacement... I exclude msvcprtd.ddl, and point the linker to the one without D instead...
 
@Fagan and Refar
Thanks for making some good progress good people. Further than what I had achieved. Be careful not to drive yourself nuts in the process. Microsoft can do this sometimes.

@anyone
Can anyone debug under this scenario:
Vista x32 + VC2005
Vista x64 + VC2005

Cheers.
 
Good news I just got my first successful debug breakpoint. :)

Well I'll list the points I did tomorrow... well today later. :D It's been a struggle so I need review what I did to make it works.
 
:goodjob:.
 
Top Bottom