Author Topic: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)  (Read 14071 times)

daniel.santos

  • Guest
Last Updated Feb 21, 2008.  Edits:
  • uses relative paths now
[li]updated [/li][/list]
Code: [Select]
[url=http://glest.codemonger.org/files/glest-vc2008proj.tgz]project files[/url] to use relative paths as well[/li]
[li]g3d_viewer and map_editor require wxWindows, not included in these instructions.  You can omit these subprojects if you wish.[/li][/list]
I finally got a good compile on my work machine (WindowsXP) using MS Visual C++ 2008 Express Edition.  I'll try to keep this guide updated.

1. Prerequisites
  • Download and install Microshaft Visual C++ 2008 Express Edition.  MSDN documentation is optional, but helpful.
  • Decide where you want to check out glest and put your dependencies.  I put mine under C:\Projects\glest.  Henceforth, we shall call this location <root>.
  • Download and extract the all-in-one
Code: [Select]
[url=http://glest.codemonger.org/files/win32-glest-deps.rar]win32-glest-deps.rar[/url]
      into <root>.[/li]
  • Checkout the glest sources.  This should look something like this:
Code: [Select]
svn co https://glest.svn.sourceforge.net/svnroot/glest/trunk glest
    [/li]
2a. Download project files
Are you lazy?  Then download my project files and hope they work:
Code: [Select]
[url=http://glest.codemonger.org/files/glest-vc2008proj.tgz]glest-vc2008proj.tgz[/url].  You extract this in the <root>/glest/source directory.

If you can't get those to work (maybe you're using a different version of VC++), you can omit this step and create your project files following the rest of this article.

2b. Creating the "Solution" and "Projects"
MSVC++ projects are contained in a "solution" (analogous to a "workspace" in other IDEs).  A single solution can contain multiple projects.  We want to create a single solution in the <root>\glest\source directory that contains projects for each of the shared_lib, glest_game and optionally g3d_viewer and map_editor directories.  However, Visual C++ Express Edition is a pain in the ass for stuff like this, probably because they would prefer you to buy their commercial products.  Thus, we have to kludge our way through.

3. Create an empty solution named "Glest"
Since there isn't a simple way to do this, we have to screw with it.
  • Create a new solution with a dummy project: Click File, New, Project From Existing Code...
  • Visual C++ project should be selected
  • Next
  • Project file location: <root>\glest\source
  • Project name: Glest
  • Finish
  • Remove the Glest project from the solution: Right click on Glest project (not the solution) and select remove
  • Close & save the solution (File, Close Solution, save when prompted)
  • Browse to <root>\glest\source and delete all of the files that were just created except for Glest.sln (cheesy huh?)
Now we have our blank solution that we'll add subprojects to later.

4. Create projects
  • File, new project from existing code
  • Next, Next
  • Project file location: <root>\glest\sourced\shared_lib
  • Project name: libglest
  • Next
  • Project type: Static library (LIB) project
  • Finish
  • File, New, Project From Existing Code...
  • Next, Next
  • Project file location: <root>\glest\sourced\glest_game
  • Project name: game
  • Finish
  • Optional: repeat for g3d_viewer and map_editor
  • Close the open solution (File, Close Solution)
  • Use explorer and go to each of the subproject folders and delete the .ncb, .sln and .suo files.  These are for the solution tied each of these projects that we don't need.
5. Put it all together
  • Open the original "Glest" solution: File, Open, Project/Solution... and select <root>\glest\source\Glest.sln
  • Add each project (File, Add, Existing Project...)
6. Configure project properties
  • Click Project, Project Dependencies... and set all projects besides libglest as being dependent on libglest.
  • Click OK.
  • Select all projects and go to properties page.
  • From the Configuration drop down at the top of the window, select All Configurations.  We will now be editing the properties for all projects and all configurations, so be careful what you change.
  • Set C/C++ -> General -> Additional Include Directories using the below values.  If you don't want to screw with their user interface, just delimit them with a semi-colen and copy and paste.
Code: [Select]
..\..\..\deps\include
..\shared_lib\include\sound\ds8
..\shared_lib\include\graphics
..\shared_lib\include\graphics\gl
..\shared_lib\include\platform\win32
..\shared_lib\include\sound
..\shared_lib\include\util
..\shared_lib\include\xml
    [/li]
  • Set C/C++ -> General -> Warning Level to 2 to avoid excess spam
  • If you want to debug using the edit and continue debug database, click Apply, switch to the debug configuration and set C/C++ -> Code Generation -> Enable Function-Level Linking = yes
  • Click OK
  • Select only the game project and go into it's properties.
  • Add all of the directories in the game project to it's own include path (C/C++ -> General -> Additional Include Directories).
  • Now select only the exe projects (game, g3d_viewer and map_editor) and go into those project properties.
  • Again, select all configurations
  • Set Linker -> General -> Additional Library Directories to include:
Code: [Select]
..\..\..\deps\lib
..\shared_lib\$(ConfigurationName)
    [/li]
  • Set Linker -> Input -> Additional Dependencies to the below value. (Note: This presumes that you want to statically link as much as possible.  Otherwise, you can choose to use dyanamic .lib files, but the DLLs will be required at run time.)
Code: [Select]
dsound.lib dxguid.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib xerces-c_2.lib opengl32.lib glu32.lib wsock32.lib libglest.lib mmc.lib
    [/li]
7. Removing unused sources & adding glprocs
Not all subdirectories of this project should be compiled on windows.  Additionally, the D3D implementation appears to be/is incomplete.  So select the following subdirectories of shared_lib, right click and select Exclude From Project.
  • sources/graphics/d3d9
  • sources/graphics/gl2
  • sources/platform/sdk
  • sources/platform/posix
  • sources/sound/openal
Right click on the libglest project, select Add/Existing Item... and browse to deps/src/glprocs.c.

8. Troubleshooting
  • If you compile Glest and somebody else tries to run in on their machine and they get "Application failed to start because side-by-side configuration is incorrect" then they either need to install 
Code: [Select]
[url=http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en]Microshaft Visual C++ 2008 Redistributable Package (x86)[/url]
    or you need to link in the C runtime libraries statically.  The later basically involves setting C/C++ -> Code Generation -> Runtime Libray to "Multi-threaded (/MT)" and then adding libcmt.lib in Linker -> Input -> Additional Dependencies and will generate a slightly larger file.[/li]
« Last Edit: 10 April 2016, 17:05:02 by filux »

theotherhiveking

  • Guest
(No subject)
« Reply #1 on: 21 February 2008, 15:23:44 »
Can someone move this to General?
« Last Edit: 1 January 1970, 00:00:00 by theotherhiveking »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
(No subject)
« Reply #2 on: 21 February 2008, 21:21:08 »
This seems kinda complex for someone who has never compiled anything before!!
« Last Edit: 1 January 1970, 00:00:00 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #3 on: 21 February 2008, 21:23:28 »
Quote from: "wciow"
This seems kinda complex for someone who has never compiled anything before!!


If you haven't compiled anything before, why would you want to compile Glest under windows?
« Last Edit: 1 January 1970, 00:00:00 by martiño »

ZaggyDad

  • Guest
(No subject)
« Reply #4 on: 22 February 2008, 19:11:02 »
Do you have hosted a compiled version of it? If so, is it "Glesty"? Because, if it is, it seems to be broken on my computer. It gets "invalid side-by-side configuration", or something like that. :cry:

The specs are: Windows XP pro, 512 MB of memory, nVidia GeForce FX 5200 with 64 MB of memory.

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
(No subject)
« Reply #5 on: 22 February 2008, 20:29:16 »
Look at this thread:

http://www.glest.org/glest_board/viewtopic.php?t=3229

It should solve your problem  ;)
« Last Edit: 1 January 1970, 00:00:00 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

daniel.santos

  • Guest
-
« Reply #6 on: 23 February 2008, 02:29:21 »
This thread should actually contain pure-Glest instructions, links and such unless I have made an error.  I've been using the name "Glesty" for my mod because I haven't come up with anything that really has seemed to stick.  You could use these instructions to compile "glesty" however.

And yea, what a freakin stupid error message.  Leave it up to the boys in Redmond.  It's trying to say "I need a newer version of mscvrt.dll."  If you want a binary of my mod, I recompiled it with to link the c runtime in statically here:
Code: [Select]
[url=http://glest.codemonger.org/files/glesty-win32_SSE2-static-r17.rar]glesty-win32_SSE2-static-r17.rar[/url],  but these instructions are intended to be generic.
« Last Edit: 10 April 2016, 17:06:41 by filux »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #7 on: 24 February 2008, 03:59:22 »
Quote from: "daniel.santos"
I've been using the name "Glesty" for my mod because I haven't come up with anything that really has seemed to stick.

Sounds a bit like 'Glest E' for Glest Evolution.  :O
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

daniel.santos

  • Guest
(No subject)
« Reply #8 on: 24 February 2008, 20:55:46 »
Dammit Hailstone!  I had just almost decided on "Glest Advanced Pack"! :) "Glest Evolution" or "Glest Evolved" sounds cool too, but that's a different topic.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

Duke

  • Guest
(No subject)
« Reply #9 on: 25 February 2008, 16:01:56 »
And Glest Evolution already exists, i think that was what he meant.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

ZaggyDad

  • Guest
(No subject)
« Reply #10 on: 26 February 2008, 16:17:08 »
Could you (daniel.santos) compile (for windows) and host the savegame patch (I've been trying to compile glest for who knows how long, and never succeeded :wink:

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

hardyvoje

  • Guest
(No subject)
« Reply #11 on: 2 March 2008, 06:21:19 »
Daniel, this post is great!
Thanks!
« Last Edit: 1 January 1970, 00:00:00 by hardyvoje »

yaoyansi

  • Guest
(No subject)
« Reply #12 on: 15 March 2008, 06:09:42 »
i just download glest-vc2008proj.tgz, open the glest.sln, game.vcproj, libsglest.vcproj in notebook, and change the following texts ,if any,and they can be used in vs2005. :)

.........change .........................................to ..............
Format Version 9.00       --->   Format Version 8.00

# Visual Studio 2008     --->     # Visual Studio 2005

Version="9.00"            ---->     Version="8.00"
« Last Edit: 1 January 1970, 00:00:00 by yaoyansi »

daniel.santos

  • Guest
(No subject)
« Reply #13 on: 15 March 2008, 07:47:38 »
sweet! thanks for the info.  I've mangled GAE to the point where those project files wont work for it any more, but at least I have the msvc++ project files checked into the GAE repository now.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #14 on: 5 November 2008, 00:11:34 »
The checkout path needs to be updated to the glestmonger url.

Code: [Select]
https://glest.codemonger.org/svn/repos/gae/['branches' or 'tags']/[the branch or release number]
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #15 on: 6 November 2008, 02:13:15 »
Anyone have something for normal glest?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

gruese

  • Guest
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #16 on: 21 November 2008, 18:50:55 »
Hey guys,

this doesn't seem to work without wxwidgets, i followed the instructions using the codemonger repository and got the compile error
"fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory"
on several files in the game project. zlib.h is one of the header files in wxwidgets' source folders.

Can anybody help me with that? Do I need to compile wxwidgets myself? If so, do I put it in as a project in the glest solution?
Thanks
chris

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #17 on: 21 November 2008, 20:51:11 »
zlib is a separate library. It should be in the win32-glest-deps.rar now. see viewtopic.php?f=15&t=3921&p=19287#p19202 at the bottom of that post.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

gruese

  • Guest
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #18 on: 21 November 2008, 22:58:30 »
Quote from: "hailstone"
zlib is a separate library. It should be in the win32-glest-deps.rar now. see viewtopic.php?f=15&t=3921&p=19287#p19202 at the bottom of that post.

Thanks for the answer, but if it's this file you and Daniel are talking about:
http://glest.codemonger.org/files/win32-glest-deps.rar
I just downloaded it and zlib is not in there yet.

Cheers
gruese

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #19 on: 22 November 2008, 00:51:40 »
Ok, try
Code: [Select]
[url=http://www.zlib.net/zlib123-dll.zip]http://www.zlib.net/zlib123-dll.zip[/url]
« Last Edit: 10 April 2016, 17:07:03 by filux »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

gruese

  • Guest
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #20 on: 22 November 2008, 02:27:16 »
Quote from: hailstone
Ok, try
Code: [Select]
[url=http://www.zlib.net/zlib123-dll.zip]http://www.zlib.net/zlib123-dll.zip[/url]

Yeah I already downloaded zlib myself and built it in there. Works like a charm now, thanks!
« Last Edit: 10 April 2016, 17:07:22 by filux »

mockrocker

  • Guest
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #21 on: 8 March 2010, 14:52:39 »
My first post here! How's everyone?

I'm trying to recompile the source I got from sourceforge but it doesn't work. There are about 120+ errors about missing files with .h extension. Can anyone help me?

I'm trying to use this guide but I can't make it work. All the download links are dead (are they?).

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #22 on: 8 March 2010, 17:29:02 »
A little history:

#1 Glest (original glest) is dead so I doubt you'll get much help with that code base.

That leaves you currently with two options:

a) GAE (Glest Advanced Engine)
or
b) Megaglest

Both of these are attempts to take original glest and add more to it. I cannot speak for GAE (I'm sure some from that team will post a reply) but for Mega-glest we have the VC++ 2008 express solution in SVN on sourceforge. The only missing items are the 3rd party win32 DLL's / Includes (which I have and will post it somewhere for everyone to download). At that point you should easily be able to compile Mega-Glest.

Thanks

EDIT:

Ok to get the win32 dependencies (dll's, libs and header files) for mega-glest you can goto:

https://sourceforge.net/projects/megaglest/files/

and get win32_deps.7z and decompress it in the "source" folder (which should create a win32_deps sub folder with tons of stuff. I am updating the VC++ 2008 express solution files to use relative paths so that anyone can just get the code from SVN into ANY folder and place this win32_deps into source and compile (should be done today)

I have now updated the VC++ 2008 express solution files in SVN for mega-glest so anyone should easily be able to produce binaries for windows
« Last Edit: 9 March 2010, 00:46:31 by softcoder »

Super Tom

  • Draco Rider
  • *****
  • Posts: 311
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #23 on: 9 March 2010, 06:06:12 »
Hi, softcoder! Sorry, I can not download glest - vc2008proj.tgz, please send to my e-mail address, thank you!

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Compiling on Win32 using no-cost tools (MSVC++ 2008 Express)
« Reply #24 on: 9 March 2010, 06:41:38 »
Sorry Tom I don't understand what you are asking for and what your problem is?