Difference between revisions of "HowTo:VCPP Compiling"

From VsWiki
Jump to: navigation, search
(Compiling under Visual C++: data4.x)
(Compiling under Visual C++: added preliminary info for vc9)
Line 18: Line 18:
 
* <code>vegastrike/vega-vc7/</code> - The project files. (VISUAL C++ 7.x)
 
* <code>vegastrike/vega-vc7/</code> - The project files. (VISUAL C++ 7.x)
 
* <code>vegastrike/vega-vc8/</code> - The project files. (VISUAL C++ 8.0)
 
* <code>vegastrike/vega-vc8/</code> - The project files. (VISUAL C++ 8.0)
* <code>vegastrike/data/</code> - The newer version of data.  Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings.
+
* <code>vegastrike/win32/</code> - The newer version of data.  Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings.
  
Here is a list of every project included for SVN compilation:
+
Here is a list of every project included for SVN compilation that is used:
 
+
* vegastrike (<code>Vegastrike.exe</code>) - '''VegaStrike binary'''
* AsterGet (<code>AsterGen.exe</code>) - Not used
+
* vsserver (<code>vegaserver.exe</code>) - VegaStrike server
* mission (<code>Mission Launcher.exe</code>) - Not used
 
* savegame (<code>Launcher.exe</code>) - '''Not required but still used for selecting missions'''
 
* texturizer (<code>Texturizer.exe</code>) - Not used
 
** REQUIRES texturizer module
 
* TriSort (<code>TriSort.exe</code>) - Not used?
 
* vsacctserver (<code>accountserver.exe</code>) - Soon to be functional in Windows
 
* vegastrike (<code>Vegastrike.exe</code>) - '''used - VegaStrike binary'''
 
* vsserver (<code>vegaserver.exe</code>) - Soon to be functional in Windows
 
 
* vssetup (<code>Setup.exe</code>) - The main Setup program--doesn't change much, so you can use the binary directly from SVN.
 
* vssetup (<code>Setup.exe</code>) - The main Setup program--doesn't change much, so you can use the binary directly from SVN.
  
Line 44: Line 36:
 
Then from the MSDEV IDE, open the "vegastrike.dsw" project inside vega-proj, and compile.  You will want to use Debug or Release configurations for a standard build. (The Boost 129 builds are permanently broken, and GLUT doesn't work very well as far as I know)
 
Then from the MSDEV IDE, open the "vegastrike.dsw" project inside vega-proj, and compile.  You will want to use Debug or Release configurations for a standard build. (The Boost 129 builds are permanently broken, and GLUT doesn't work very well as far as I know)
  
 +
 +
==Visual C++ 9.0 (2008 Express)==
 +
I think this is only for Windosw XP SP3 and Vista (so probably not win2k).
 +
 +
You can get the downloader here:
 +
http://www.microsoft.com/express/download/
 +
Make sure to be *logged on* as admin.  Otherwise you will get some weird error 3MB into the download.
 +
Run the installer, uncheck all the boxes on each page if you want a lighter download.
 +
 +
It will do everything on it's own then ask to reboot.
 +
Apparently no Platform SDK is necessary (at least it seemed that way for me, but maybe that's because I already had VC7 installed.  Please someone post here if you try it out on a new install.
 +
 +
I was hoping that I could just use the vega-vc8 directory but Python seems to be incompatible so we will need a new version of python... still, it may be possible to provide slightly modified projects in the vc8 directory for vc9 support with a few different .libs.
  
 
==Visual C++ 8.0 (2005 Express)==
 
==Visual C++ 8.0 (2005 Express)==

Revision as of 06:48, 2 June 2008

arrow_left.png Checkout SVN arrow_up.png HowTos Cygwin Compiling arrow_right.png

Compiling under Visual C++

First, check out the SVN modules.

When using another module (e.g. vegastrike, vssetup), they should be placed in the directory above vega-proj in the directory tree.

For example, when you want to checkout Vegastrike, you may make a Vegastrike directory and from there, checkout vega-proj (or vega-vc7 for "dot-NET" or vega-vc8 for Express users), vegastrike, data ALL from this directory.

  • vegastrike/ - base directory.
  • vegastrike/vegastrike/ - The stuff from the vegastrike module (the actual code)
  • vegastrike/vega-proj/ - The project files. (VISUAL C++ 6.x)
  • vegastrike/vega-vc7/ - The project files. (VISUAL C++ 7.x)
  • vegastrike/vega-vc8/ - The project files. (VISUAL C++ 8.0)
  • vegastrike/win32/ - The newer version of data. Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings.

Here is a list of every project included for SVN compilation that is used:

  • vegastrike (Vegastrike.exe) - VegaStrike binary
  • vsserver (vegaserver.exe) - VegaStrike server
  • vssetup (Setup.exe) - The main Setup program--doesn't change much, so you can use the binary directly from SVN.

Visual C++ 6.0 (deprecated)

As of the end of December, 2005, VegaStrike has dropped compatibility for VC 6 because of the new OGRE rendering engine.

VC 6 users can grab a free copy of VC 8 (Visual Studio 2005 Express) off the Microsoft site, and follow the directions below to compile.

Compiling using VC 6

Until the OGRE port is finished, VC 6 will still compile, so you can try it if VC8 won't work for you.

First, check out all the modules above.

Then from the MSDEV IDE, open the "vegastrike.dsw" project inside vega-proj, and compile. You will want to use Debug or Release configurations for a standard build. (The Boost 129 builds are permanently broken, and GLUT doesn't work very well as far as I know)


Visual C++ 9.0 (2008 Express)

I think this is only for Windosw XP SP3 and Vista (so probably not win2k).

You can get the downloader here: http://www.microsoft.com/express/download/ Make sure to be *logged on* as admin. Otherwise you will get some weird error 3MB into the download. Run the installer, uncheck all the boxes on each page if you want a lighter download.

It will do everything on it's own then ask to reboot. Apparently no Platform SDK is necessary (at least it seemed that way for me, but maybe that's because I already had VC7 installed. Please someone post here if you try it out on a new install.

I was hoping that I could just use the vega-vc8 directory but Python seems to be incompatible so we will need a new version of python... still, it may be possible to provide slightly modified projects in the vc8 directory for vc9 support with a few different .libs.

Visual C++ 8.0 (2005 Express)

Warning: VC8 requires a big download off Microsoft's site.

Microsoft claims that they will continue offering their non-expiring version of VC8 forever, so I guess this will be the main build platform.

Keep in mind that VC8 does something weird with .manifest files, and for official builds, I would suggest VC7 as it seems to be faster, and it lacks compatibility issues. There are too many forum threads on this to count.

This will work on Windows 2000 or XP (Not sure about 98,95...).

  1. You have two download choices:
  2. Install the Windows Platform SDK (Instructions - FULL ISO version(395MB)). A more recent SDK for Windows XP SP2 exists, but it has not been tested with VS (yet.)
  3. In Visual C++ 8.0 (2005 Express), under Tools...Options...Visual C++ Directories, add an Include directory for C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include and an Include directory for C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc. If you forget this step, the build will not be able to find windows.h, basetsd.h, and afxres.h and will throw fatal errors.
  4. You should not need the DirectX SDK (337MB) to compile VS, but it may be required to compile OGRE in the future.
  5. Disable Intellisense: Microsoft provides no GUI for this, but it is recommended unless you want to eat up twice the RAM and wait 10-20 seconds between saving each file.
    • Browse to your VC8 install.
    • Go to the VC/vcpackages folders and rename the "feacp" DLL file to anything else like "feacp_backup.dll". This should not break anything... it will only disable IntelliSense.
  6. Checkout the Vegastrike project as described earlier.
  7. Open the "vega-vc8" project using the IDE.
  8. The compilation should go for the most part smoothly. If you encounter any problems, please tell us in the forum or specifically on this thread.
    • Note that Debug versions will be very slow (I get 5 frames/second on my Pentium3 1GHz machine using debug VS).

Visual Studio 7.x

Compiling from the command line with Visual Studio

Here is a batch file that could be used to checkout everything and then compile all projects (copy and paste in makeall.bat), if you were going somewhere for a few hours and wanted to get a working project when you got back:

@echo off
mkdir vegastrike
cd vegastrike
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vega-vc7
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vegastrike
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/
cd vega-vc7
echo Building project...
"C:\VC7\Common7\IDE\devenv.exe" vegastrike.sln /BUILD Debug
cd ..
cd ..

NOTE: You must replace the "C:\vc7" with the directory where you installed visual c++ 7 and replace the "Debug" on the same line with "Release" if you want a release build.

Compiling with the Visual Studio GUI

(This is written with Visual C++ .NET Standard in mind)

Once you have checked out the vegastrike and vega-vc7 modules from CVS, use Visual Studio to open vegastrike.sln, found in the vega-vc7 directory. When compiling for release, select "Release Boost 131" from the drop-down menu on the toolbar. Right-click on the "vegastrike" project in the "solution explorer" sidebar, and then select "Build".

Visual C++ Toolkit 2003

This is a free download from Microsoft, and is the same compiler and linker as Visual Studio 2003.

Note, you must have Windows XP or 2000 in order to install the toolkit. (formerly said only Windows XP, but this is not true according to their download page)

Downloads


Configuring Code::Blocks

  • Run CodeBlocks. The first time you install it, you will be listed with a set of compilers. Select Microsoft Visual C++ Toolkit, and click Set As Default.
  • For configuration you have to include the location of the Windows Platform SDK. Go to Settings -> Compiler in the menu. Click the Directories tab. Add the directory "C:\Program Files\Microsoft SDK\bin" to the Resource Compiler tab.

Compiling with Code::Blocks and Visual C++ Toolkit

Once you have checked out the vegastrike and vega-vc7 modules from CVS, import the vegastrike.sln file, found in the vega-vc7 directory into Code::Blocks using Project->Import->MS Visual Studio Solution in the menu.

Note (CVS version as of 14 Nov 2005

Using the most recent CVS versions (and 2003/Runtime versions from Microsoft) I had to remove /W from the build options Project Build Options > Compiler Options > Other Options

See Also


arrow_left.png Checkout SVN arrow_up.png HowTos Cygwin Compiling arrow_right.png