Page 1 of 1

VS2008 + AIs using the C++ Wrapper

Posted: 28 Feb 2010, 23:14
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.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 09:25
by imbaczek
good stuff.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 10:42
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.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 10:47
by AF
I didn't think it was possible in the first place what with the compiler differences?

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 11:16
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.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 12:35
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.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 15:46
by ivand
Thanks AF.

I had lots of troubles with cmake under windowz.
Did you use ".def" file to stop name mangling?

Re: VS2008 + AIs using the C++ Wrapper

Posted: 01 Mar 2010, 16:16
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.

Re: VS2008 + AIs using the C++ Wrapper

Posted: 04 Mar 2010, 18:57
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