Compiling r12925 on Windows 7 with Visual C++ Express 2010

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).

Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby Kuoxsr » Sat Oct 09, 2010 5:59 pm

Hi there to anyone who may be interested.

Last night, I started to build the latest source files in Visual Studio 2010 (that would be revision 12925.) My hope is that I can streamline the build process and create a step by step list that anyone should be able to follow. From other posts, it appears that there have been some major changes lately that make it difficult to build Vega Strike on Windows, with some people questioning whether it's even going to be possible. I saw that shenle attempted this a while ago, but there doesn't appear to be any resolution to it.

Rather than revert to the revision shenle used and go through his steps, I decided to start fresh from revision 12925.

Here is what I have done so far:

  • Installed Visual C++ 2010 Express
  • Installed SVN (and Tortoise)
  • Installed Python 2.6 (actually, I tried the latest version first, and then discovered that PYString_FromString was missing, so I had to revert)
  • Installed Boost 1.44 (not sure whether I can make this work yet, as Vega Strike is currently built against 1.35, I think)
  • Installed the Windows 7 platform SDK
  • Checked out Vega Strike's head revision source code (12925)
  • Copied the vega-vc8 folder and renamed the new folder to vega-vc10
  • Opened the vegastrike2008.sln solution file from the vega-vc10 folder in the IDE, and told Visual C++ 2010 to convert the project. I'll rename it to 2010 once it compiles.

Here are a few things I did when the first compile was filled with errors:

  • Went into the properties of the "vegastrike" project (Configuration Properties|C/C++|General|Additional Include Directories), and changed the boost folder to my boost installation location "$(MSBuildProgramFiles32)\boost\1_44". I did this for every possible configuration.
  • Installed the OpenAL11SDK, to try to fix an issue with dev = alcOpenDevice( "DirectSound3D" ). Installing the openAL SDK did nothing. In the end, I had to do the following: dev = alcOpenDevice( (ALCubyte*)"DirectSound3D" ). There was another thread about this, but the only advice was to get the latest version of openal. Since I've never intentionally installed the openal library before today, I assume I must have the latest version.
  • Deleted the "boost" folder from the "vegastrike" project, because the linkage to these files was hard-coded to "..vegastrike\boost\1_35\src\" and there was nothing there in SVN. Generally, it's not considered good practice to copy files from someone else's library into your source folder; makes it harder to stay up to date that way. Once I redirected the include folders to my local 1_44 boost installation and deleted the hard-coded boost folder, most of my file not found errors went away, which is good, because finding how it kept asking for 1_35 was truly maddening.
  • Deleted the following files from the following folders (only in the project file, of course): cmd\unit_bsp.cpp & .h, gfx\bounding_box.cpp & h, gfx\bsp.cpp & h, and gui\general.cpp & h. These files were nowhere to be found in the vegastrike source code in SVN. I can only assume that further development on a Linux version removed them, and the project file got out of date.

I now have only one error (for now):

error C3861: 'png_set_expand_gray_1_2_4_to_8': identifier not found

Anyone have any thoughts? I've attached my build log.

Thanks in advance.
Attachments
Build log.txt
(21.58 KiB) Downloaded 179 times
Kuoxsr
Explorer
Explorer
 
Posts: 12
Topics: 1
Joined: Tue Oct 05, 2010 10:45 pm

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby klauss » Sun Oct 10, 2010 1:26 pm

The change was done in r12688, fixing ticket #18 ( http://vegastrike.wcjunction.com/trac/ticket/18 if you can see it without logging in ), basically, newer versions of libpng have deprecated some functions and they were replaced by the ones your compiler can't find.

You'd have to update the libraries to newer versions.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby ace123 » Sun Oct 10, 2010 5:49 pm

I ran into the same error, so I looked in a header, and saw a similar version that was missing "expand_" (the comment said it was also expanding colors, so I assume it was just renamed).

I just committed a fix to use that one instead for WIN32.
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby Kuoxsr » Tue Oct 12, 2010 1:18 am

Well, I was able to compile the latest revision with VS2008 and 2010. Hooray!

The problem is that the binaries that get built won't run. Well, to be more precise, they won't stay running.

When it starts up, where there should be a splash screen, I see nothing but a red rectangle. Music plays for a while, and I can see modules loading, but eventually it crashes. The last thing it loads (at least that it reports on-screen) is spec04.image, and then it dies.

I'll try to track down what might be going wrong. I assume that ace123 does not have the same error...
Kuoxsr
Explorer
Explorer
 
Posts: 12
Topics: 1
Joined: Tue Oct 05, 2010 10:45 pm

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby shenle » Mon Oct 18, 2010 12:42 pm

Yes, I have the same result. I managed to compile the latest svn (12930) after replacing all of boost with the latest revision; in addition to what was said above, I had to replace all of the "boost" files themselves in the project with the newer versions.

The generated binary runs, but only shows a solid red rectangle then crashes.

FWIW I'm attaching the stdout and stderr.

I'm pretty sure we're missing on something big.
Attachments
stdout2.txt
(442 Bytes) Downloaded 159 times
stderr2.txt
(1.29 KiB) Downloaded 181 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 381
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby Kuoxsr » Mon Oct 18, 2010 6:42 pm

I'm glad I'm not the only one.

In debugging the app, it seems to crash on line 479 of winsys.cpp, several times through the loop.

Not sure why yet, though.
Kuoxsr
Explorer
Explorer
 
Posts: 12
Topics: 1
Joined: Tue Oct 05, 2010 10:45 pm

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby shenle » Tue Oct 19, 2010 10:02 am

Here's more information.

I use 2 computers, let's call them "build machine" which runs Windows 7, and "test machine" which runs XP.

On the build machine, the compiled binary of rev.12930 behaves as above (red rectangle then crash). The vegastrike.exe from the win32 svn folder (rev.12926 committed by ace123 on 10/10) also does the same. Some previous builds (rev 12742, 12748 and 12763) begin loading, show some splash screens then crash with a runtime error.

On the test machine, ace123's binary from the svn runs perfectly fine. :o
I did not test my binary on the test machine yet... but I wouldn't be surprised if it runs there too. I'll try it tonight. The older builds crash on that machine also.

Now, the test machine used to be my previous build machine when I was experimenting with codeblocks+VC toolkit, cmake on Windows, various libraries etc. It's hard to say at this point what extra stuff it has that's not on my (current) build machine.

(edit) I've tested my compiled binary of rev 12930 on the test machine, it starts running and actually displays a couple of startup images, then crashes. No red rectangle. Stdout/stderr attached, but I see nothing useful in there.
Attachments
stdout.txt
(685 Bytes) Downloaded 165 times
stderr.txt
(1.26 KiB) Downloaded 165 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 381
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby ace123 » Tue Oct 19, 2010 8:36 pm

The one glaring difference between your build and mine is Visual C++ Express 2010 instead of 2008, so I'm going to wager a guess that there's some sort of subtle incompatibility between the two, and some of the .lib's we use need to be recompiled.

I'm probably not going to install yet another version of visual studio on my computer for a while, so if you use 2010, you're kind of on your own for now.

I will suggest either getting 2008 SP1 for now, or try to dig deeper into the cause of the crash. If you can reproduce the problem on VC 2008, then it will be easier for me to find a workaround so that we aren't changing two variables (new VC version + new computer)

Thanks for testing this.
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby shenle » Tue Oct 19, 2010 9:35 pm

Well 2008 isn't available anymore, 2010 is all you can get.

And... your compiled binary, inside a freshly checked out win32 folder, works on the XP computer... but not on the Windows 7 one. The XP computer may have on it some older libraries (or may not), but the Win7 one for sure doesn't have any crap laying around.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 381
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby ace123 » Tue Oct 19, 2010 10:08 pm

They always go one revision back for compatibility reasons.

Did you try this one?
http://www.microsoft.com/express/Downlo ... _Downloads

but not on the Windows 7 one.

I built and tested my binary on windows 7, so it shouldn't be a compatibility problem.
The red rectangle sounds like a graphics driver issue, especially if it happened on previous versions as well.
Make sure you have the latest Intel/NVIDIA/ATI drivers from the chip manufacturer's website (don't get them from Microsoft's site--those are years out of date).
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby shenle » Tue Oct 19, 2010 10:14 pm

Yes, ATI drivers up-to-date on the Win7 machine, and nVidia on the XP one...

The red rectangle only happens on the Win7 computer, and it happens with both my compiled version, and with yours. It does not happen on XP with either version (but mine still crashes there too while yours runs).
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 381
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby Kuoxsr » Wed Oct 20, 2010 7:25 am

I thought that it might be VC2010 as well, so I installed 2008 and built it (same day.) I got the same red rectangle and crash.

Older versions worked on Windows 7. For example: r12868 runs just fine.

Something has changed with this revision.
Kuoxsr
Explorer
Explorer
 
Posts: 12
Topics: 1
Joined: Tue Oct 05, 2010 10:45 pm

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby ace123 » Wed Oct 20, 2010 8:11 pm

Yikes. Anything could have changed between those two builds.

May I suggest possibly going into setup.exe and turning off shaders and turning down some other things?
I don't have an ATI computer so it might be something we're doing wrong there.

Another possibility is a sound-related crash. We found some sound cards which crashed Vega Strike in some cases, such as when there was no speaker cable plugged into the computer.
I think we fixed all the sound issues, but it's possible that your audio driver does something different.
To test this, can you try turning Sound/Music off in Setup.exe?

r12868 was a binary from around March, 2010 built with VS 2003 or 2005--so completely different. There's been months of development between the two (especially the new sound system).
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby Kuoxsr » Thu Oct 21, 2010 5:46 pm

Sound: no sound
Music: Off
Video: Retro detail
Shaders: No shader support

I still get a red rectangle, and it eventually crashes.

Here's the error from Visual C++:

Unhandled exception at 0x77918c19 in vegastrikeD.exe: 0xC0000005: Access violation writing location 0x00000014.


The last item on the call stack is the following line of code:

PyRun_SimpleFile( inFile, pyfile );

This is on line 91 of base_xml.cpp.

Maybe I have the wrong version of python? How do I correctly install that? Is there a special procedure I need to follow to make sure I have the right version of Python? I installed 2.6, but is this the right version?

See the attachment for the contents of inFile the moment it crashes.
Attachments
bad pointer.png
Kuoxsr
Explorer
Explorer
 
Posts: 12
Topics: 1
Joined: Tue Oct 05, 2010 10:45 pm

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby pheonixstorm » Sat Nov 13, 2010 5:22 pm

Compiling for win32 has always been a real bitch... I had a working exe for awhile but that was pre cubemaps... which is another thing to ask about. Did the project file you used to compile have cubemaps included? I havent checked any of the source lately (been running ragged by a new baby and trying to find work), but have recently started back on a few of my projects.

I will see if I can find my backup of what I was working on.. If not I will rebuild everything again.

Don't forget to recompile ALL of the dll files that are required (not many) suchs as python. On a side note has ffmpeg been included yet?? If so that will need to be compiled under mingw and NOT VC according to the sites win compile doc.

Maybe I can get another working build going again... It was such a pain the first time around... I have one build machine running VC6 and VC8 while this machine will end up running VC9 under XP and VC10 under 7 (tri boot xp/7/ubuntu hehe)

Heres hoping for a stable win build :mrgreen:
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
User avatar
pheonixstorm
Elite
Elite
 
Posts: 1567
Topics: 113
Joined: Mon Jan 25, 2010 7:03 pm

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby ace123 » Sun Nov 14, 2010 1:28 pm

The only way to know you have the correct version of python is to compile it yourself, using VC 2010, in both Debug and Release, as crappy as it may seem. Then, make sure your project references the includes from that version of python, as well as the debug and release "python26.lib" that your compile generated. At this point, you'll need to Rebuild All in the vegastrike.sln!

Also, you'll need to have the DLLs fom that version (both the debug and release versions) in the same bin directory as vegastrike. If you get stuck on this part, there's a program called "Dependency Walker" you can download (depends.exe) which will tell you which DLL version it is actually using, and you can move things around until it finds your version. At that point, you will definitely stop getting crashes in python code.

If you don't want to do this, it is possible to fix the python errors by making sure you pass no data structures between Vegastrike and Python. In your case, the reason it's likely crashing is because you're passing a FILE*, and the size of a FILE has changed between versions of Visual Studio (I remember having this bug in other places). It might be enough to change that code segment to read in all the data from the file, and then do PyRun_SimpleString instead of PyRun_SimpleFile.
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Re: Compiling r12925 on Windows 7 with Visual C++ Express 2010

Postby pheonixstorm » Sun Nov 14, 2010 10:23 pm

Adding NV_CUBE_MAP to the preprocessor directives will clear up the white space background under the other compile. Not sure about the white ship yet...
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
User avatar
pheonixstorm
Elite
Elite
 
Posts: 1567
Topics: 113
Joined: Mon Jan 25, 2010 7:03 pm



Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 2 guests

cron