vssetup doesn't build in visual c++/Windows

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

vssetup doesn't build in visual c++/Windows

Post by shenle »

Trying to compile vssetup in visual c++ 2003 toolkit (first time in over 2 years that I've tried doing that), I get:

setup.cpp
..\..\vegastrike\setup\src\c\setup.cpp(208) : error C2065: 'HOMESUBDIR' : undeclared identifier
..\..\vegastrike\setup\src\c\setup.cpp(208) : error C2228: left of '.c_str' must have class/struct/union type
type is ''unknown-type''
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Re: vssetup doesn't build in visual c++/Windows

Post by ace123 »

Go to line 207 and swap the "chdir" with the last #endif -- that is, keep it within the #ifndef _WIN32.

That was a last minute fix I made after the 0.5.0 Windows release was already out, in order to move the "chdir" after the "mkdir" in non-windows systems (otherwise, it would fail to find the directory the first time around before making it).

On Windows, we do not use home directories, so the vegastrike.config is saved directly in the data folder.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: vssetup doesn't build in visual c++/Windows

Post by shenle »

That worked. However I still can't get the compile to finish. This time, at the final linking stage I get:

display_gtk.obj : error LNK2019: unresolved external symbol __imp__ShellExecuteA@24 referenced in function "void __cdecl myexit(int)" (?myexit@@YAXH@Z)


(edit) Ahh, got it. You need to add shell32.lib from the PSDK manually as an external dependency to the linker. Now it links cleanly.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Re: vssetup doesn't build in visual c++/Windows

Post by ace123 »

If that's the only error, it may be easier to get the function dynamically using LoadLibrary... and I think that ShellExecute call is only used for loading the readme file in notepad. It should be safe to comment out.
Post Reply