Difference between revisions of "HowTo:VCPP Compiling"

From VsWiki
Jump to: navigation, search
(Visual C++ 8.0 (2005 Express): A few small VC8 corrections)
(modernizing VCPP page to mention SVN.)
Line 1: Line 1:
 
{{NAV_Manual |
 
{{NAV_Manual |
| previous=[[HowTo:Checkout CVS|Checkout CVS]]
+
| previous=[[HowTo:Checkout SVN|Checkout SVN]]
 
| up=[[HowTos]]
 
| up=[[HowTos]]
 
| next=[[HowTo:Cygwin Compiling|Cygwin Compiling]]
 
| next=[[HowTo:Cygwin Compiling|Cygwin Compiling]]
Line 7: Line 7:
 
{{attention}}
 
{{attention}}
 
=Compiling under Visual C++=
 
=Compiling under Visual C++=
First, [[HowTo:Checkout_CVS|check out the CVS modules]].
+
First, [[HowTo:Checkout_SVN|check out the SVN modules]].
  
 
When using another module (e.g. <code>vegastrike</code>, <code>vssetup</code>), they should be placed in the directory above <code>vega-proj</code> in the directory tree.
 
When using another module (e.g. <code>vegastrike</code>, <code>vssetup</code>), they should be placed in the directory above <code>vega-proj</code> in the directory tree.
  
For example, when you want to checkout Vegastrike, you may make a <code>Vegastrike</code> directory and from there, checkout <code>vega-proj</code> (or <code>vega-vc7</code> for "dot-NET" or <code>vega-vc8</code> for Express users), <code>vegastrike</code>, <code>data</code> and then <code>vssetup</code> ALL from this directory.
+
For example, when you want to checkout Vegastrike, you may make a <code>Vegastrike</code> directory and from there, checkout <code>vega-proj</code> (or <code>vega-vc7</code> for "dot-NET" or <code>vega-vc8</code> for Express users), <code>vegastrike</code>, <code>data4.x</code> ALL from this directory.
  
 
* <code>vegastrike/</code> - base directory.
 
* <code>vegastrike/</code> - base directory.
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/vssetup/</code> - the vssetup module directory.
+
* <code>vegastrike/data4.x/</code> - The newer version of data.  Does not need -kb  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/texturizer/</code> - If you want to compile the texturizer.
 
* <code>vegastrike/data4.x</code> - The newer version of data.  Does not need -kb  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.
 
  
module <code>data</code> (the old data module) is the one exception to this rule.  Can be put anywhere on your hard drive. DATA (NOT <code>data4.x</code>, only <code>data</code>) '''MUST''' BE CHECKED OUT WITH THE <code>-kb</code> PARAMETER (=BINARY MODE)  The <code>data</code> module is for really old data only (up to version 3.9).
+
Here is a list of every project included for SVN compilation:
 
 
Here is a list of every project included for CVS compilation:
 
  
 
* AsterGet (<code>AsterGen.exe</code>) - Not used
 
* AsterGet (<code>AsterGen.exe</code>) - Not used
Line 35: Line 31:
 
* vegastrike (<code>Vegastrike.exe</code>) - '''used - VegaStrike binary'''
 
* vegastrike (<code>Vegastrike.exe</code>) - '''used - VegaStrike binary'''
 
* vsserver (<code>vegaserver.exe</code>) - Soon to be functional in Windows
 
* vsserver (<code>vegaserver.exe</code>) - Soon to be functional in Windows
* vssetup (<code>Setup.exe</code>) - '''used'''
+
* vssetup (<code>Setup.exe</code>) - The main Setup program--doesn't change much, so you can use the binary directly from SVN.
** REQUIRES <code>vssetup</code> module
 
  
 
==Visual C++ 6.0 (deprecated)==
 
==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.
 
As of the end of December, 2005, VegaStrike has dropped compatibility for VC 6 because of the new OGRE rendering engine.
  
Until mid-January, VC 6 users may still be able to get it to compile under the Debug Boost 129/Release Boost 129 project settings (Do not use the standard Debug and Release).
+
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.
  
This is not to say that it won't completely work... if you have a lot of experience in C++, you may be able to kludge OGRE to get it to compile and maybe run.
+
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)
  
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.
 
  
 
==Visual C++ 8.0 (2005 Express)==
 
==Visual C++ 8.0 (2005 Express)==
Line 75: Line 73:
 
mkdir vegastrike
 
mkdir vegastrike
 
cd vegastrike
 
cd vegastrike
echo ***** Type in {ENTER} for password when asked *****
+
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vega-vc7
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike login
+
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vegastrike
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co vega-vc7
+
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/data4.x
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co vegastrike
 
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co vssetup
 
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co texturizer
 
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike co data4.x
 
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/vegastrike logout
 
 
cd vega-vc7
 
cd vega-vc7
 
echo Building project...
 
echo Building project...
Line 119: Line 112:
  
 
=See Also=
 
=See Also=
* [[HowTo:Checkout CVS|Checking out CVS]]
+
* [[HowTo:Checkout SVN|Checking out SVN]]
 
* [http://www.codeblocks.org Code:Blocks IDE]
 
* [http://www.codeblocks.org Code:Blocks IDE]
  
 
----
 
----
 
{{NAV_Manual |
 
{{NAV_Manual |
| previous=[[HowTo:Checkout CVS|Checkout CVS]]
+
| previous=[[HowTo:Checkout SVN|Checkout SVN]]
 
| up=[[HowTos]]
 
| up=[[HowTos]]
 
| next=[[HowTo:Cygwin Compiling|Cygwin Compiling]]
 
| next=[[HowTo:Cygwin Compiling|Cygwin Compiling]]

Revision as of 03:58, 26 November 2006

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, data4.x 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/data4.x/ - The newer version of data. Does not need -kb 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:

  • AsterGet (AsterGen.exe) - Not used
  • mission (Mission Launcher.exe) - Not used
  • savegame (Launcher.exe) - Not required but still used for selecting missions
  • texturizer (Texturizer.exe) - Not used
    • REQUIRES texturizer module
  • TriSort (TriSort.exe) - Not used?
  • vsacctserver (accountserver.exe) - Soon to be functional in Windows
  • vegastrike (Vegastrike.exe) - used - VegaStrike binary
  • vsserver (vegaserver.exe) - Soon to be functional in Windows
  • 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++ 8.0 (2005 Express)

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

Until November 6, 2006, Microsoft seems to be offering a non-expiring version of VC8. After November 2006 we will find another way to compile Vegastrike on Windows.

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. You should not need the DirectX SDK (337MB) to compile VS, but it may be required to compile OGRE in the future.
  4. 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.
  5. Checkout the Vegastrike project as described earlier.
  6. Open the "vega-vc8" project using the IDE.
  7. 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/data4.x	
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