VS2008 + AIs using the C++ Wrapper

VS2008 + AIs using the C++ Wrapper

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

VS2008 + AIs using the C++ Wrapper

Post by AF »

http://darkstars.co.uk/2010/vs2008-ais-and-the-c-api/

I've put up a pre-packaged empty project with instructions and fixes. I've automated stuff like copying over AIInfo.lua, and added in the dll calling conventions and export fixes.

It's based on the C++ Test AI in the spring repo.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: VS2008 + AIs using the C++ Wrapper

Post by imbaczek »

good stuff.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: VS2008 + AIs using the C++ Wrapper

Post by slogic »

Have you managed to setup project so debug symbols are built into DLL, and Spring really uses them in its crash handler? I could achieve this only with external PDB file which is inconvenient to distribute. I tried to link with /Z7 mode when symbols are built in obj files, but Spring does not use them.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: VS2008 + AIs using the C++ Wrapper

Post by AF »

I didn't think it was possible in the first place what with the compiler differences?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: VS2008 + AIs using the C++ Wrapper

Post by imbaczek »

yeah, that's not possible. VS will show the stacktrace of whatever it compiled, though, so you can debug your AI easily even if you've got a mingw-built spring. addr2line doesn't understand any of it, unfortunately.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: VS2008 + AIs using the C++ Wrapper

Post by slogic »

I think some of you misunderstood me. I'm talking about stacktrace in infolog.txt with full featured function names. With PDB file it works (yeah, spring.exe was taken from original installation, not compiled by me). You just need to put it in spring.exe folder. The purpose is: getting useful AI crash logs from users when AI is compiled by MSVC.
ivand
Posts: 310
Joined: 27 Jun 2007, 17:05

Re: VS2008 + AIs using the C++ Wrapper

Post by ivand »

Thanks AF.

I had lots of troubles with cmake under windowz.
Did you use ".def" file to stop name mangling?
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: VS2008 + AIs using the C++ Wrapper

Post by slogic »

ivand wrote:...Did you use ".def" file to stop name mangling?
http://darkstars.co.uk/2010/vs2008-ais-and-the-c-api/ wrote:I also corrected the dll exports issue with a .def file and setting the project to use stdcall calling conventions.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: VS2008 + AIs using the C++ Wrapper

Post by AF »

I've updated the project file after noticing that if you do not already have a Minor/dev/ folder it will fail the custom build steps. I've added mkdir commands to fix this
Post Reply

Return to “AI”