How to compile BZFlag on Visual C++ 2008

Questions or HOWTOs about the above? Post 'em here...
Anxuiz
Private First Class
Private First Class
Posts: 31
Joined: Fri Sep 05, 2008 3:38 am

How to compile BZFlag on Visual C++ 2008

Post by Anxuiz » Sat Feb 07, 2009 9:25 pm

This tutorial is written in two different versions: 2.0.12 and 2.99.x

2.0.16

Requirements:

Note: I recommend saving libCURL, GLEW and PDCurses to the desktop as we need to move things from them later. Setting up the build environment:
  • Open up the folder "C:/Program Files/Visual Studio 9/vc/"
    Image
  • Copy the include directory from GLEW and libCURL to "C:/Program Files/Visual Studio 9/vc/includes/", also put the .h files from PDCurses into that directory.
    Image
  • Copy the libs directory from GLEW and libCURL to "C:/Program Files/Visual Studio 9/vc/libs/", also put the .lib file from PDCurses into that directory.
    Image
  • Copy the bin directory from GLEW to "C:/Program Files/Visual Studio 9/vc/bin"
    Image
  • Put the .dll from PDCurses into "C:/WINDOWS"
  • Open Visual C++ 2008
  • Click on "Tools" at the top of your screen and then select "Options" from that menu.
    Image
  • Click on "Projects and Solutions" then click on "VC++ Directories".
    Image
  • Change the drop down box on the upper right corner of that window to read "Include files".
  • Add a line by clicking on the folder button.
  • Click on the "..." button to the right of the text box and browse to "c:/path/to/directx/installation/Include" and click on "Select Folder".
  • Change the drop down box on the upper right corner of the VC++ Directories menu to read "Library files".
  • Add a line by clicking on the folder button.
  • Browse to "c:/path/to/directx/installation/Libs/x86" and click on "Select Folder".Image
  • Click on "OK"
Compiling BZFlag:
  • Download the BZFlag 2.0.16 source from http://sourceforge.net/projects/bzflag/ ... p/download
  • Unzip the source to a folder of your choice.
  • Open "BZFlag.sln" in "path/to/bzflag/source/win32/vc8/"
  • Do all conversions directed by Visual C++ 2008
  • Right click "Solution 'BZFlag'" and click on "Configuration Manager"
  • In the upper left corner of the window, change debug to release.
  • Note: If you do not have PDCurses, skip the next step.
  • Also, go down to BZAdmin and change it from release to release_pdcurses.
    Image
  • Click close.
  • Right click "Solution 'BZFlag'" and click on "Build solution".
  • This will take 20-30mins.
  • When the build is done, the BZFlag client, BZFS, and BZAdmin will be located in "path/to/bzflag/source/"
  • Copy the glew32.dll file from the GLEW/bin folder, the libcurl.dll file from libcurl/lib folder, and the pdcurses.dll file from from pdcurses folder if you built with pdcurses.
  • And now you're done!
Last edited by Anxuiz on Fri May 14, 2010 11:05 pm, edited 5 times in total.

Anxuiz
Private First Class
Private First Class
Posts: 31
Joined: Fri Sep 05, 2008 3:38 am

Re: How to compile BZFlag on Visual C++ 2008

Post by Anxuiz » Sat Feb 07, 2009 9:26 pm

2.99.x

I recommend setting up the build environment for 2.0.12 and testing it before you start 2.99.x

Requirements:
Setting up the build environment:

  • Open up the folder "C:/Program Files/Visual Studio 9/vc/"
  • Put "panel.h" and "curses.h" from PDCurses into the folder "C:/Program Files/Visual Studio 9/vc/includes/".
  • Put "pdcurses.lib" from PDCurses into the folder "C:/Program Files/Visual Studio 9/vc/libs/".
  • Put the .dll from PDCurses into "C:/WINDOWS"
  • Open Visual C++ 2008
  • Click on "Tools" at the top of your screen and then select "Options" from that menu.
    Image
  • Click on "Projects and Solutions" then click on "VC++ Directories".
    Image
  • Change the drop down box on the upper right corner of that window to read "Include files".
  • Add a line by clicking on the folder button.
  • Click on the "..." button to the right of the text box and browse to "c:/path/to/directx/installation/Include" and click on "Select Folder".
  • Change the drop down box on the upper right corner of the VC++ Directories menu to read "Library files".
  • Add a line by clicking on the folder button.
  • Browse to "c:/path/to/directx/installation/Libs/x86" and click on "Select Folder".Image
  • Click on "OK"
Compiling BZFlag:
  • Create a folder where you want the SVN to be placed.
  • Right click that folder and click on "SVN checkout".
  • Note: The SVN root for BZFlag is "https://bzflag.svn.sourceforge.net/svnroot/bzflag/", but you probably only want the trunk which is "https://bzflag.svn.sourceforge.net/svnr ... lag/trunk/"
  • In the top box put the SVN root. (I recommend only trunk)
  • Click on "checkout".
  • Depending on your connection this may take up to 10 minutes.
  • Open "path/to/trunk/bzflag/MSVC/build/BZFlag.sln"
  • Right click on "Solution 'BZFlag'" and select "Configuration Manager".
  • Change the top left corner drop down box to read "Debug" if it isn't already.
  • Click "OK"
  • Right click on the solution again and select "Build Solution".
  • That will take 20-30 minutes.
  • Once it is done, the BZFlag client, BZFS, and BZAdmin are located in "path/to/trunk/bzflag/"
  • And that's it!
Last edited by Anxuiz on Sat May 29, 2010 6:53 pm, edited 4 times in total.

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Sat Feb 07, 2009 10:29 pm

This could go into the wiki.

http://my.bzflag.org/w/Compiling

The "Visual C++" is quite barren right now. ;)

Might be interesting to see if the readme file for windows (in the source) is up to date as well.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

angryfirelord
Private First Class
Private First Class
Posts: 23
Joined: Fri Dec 15, 2006 12:29 am

Re: How to compile BZFlag on Visual C++ 2008

Post by angryfirelord » Tue Apr 21, 2009 1:42 am

Ah, thank you for this post! :) While I find Linux and its tools a neat thing to play around with, much of my work done for college application projects is done within the Windows environment. This is great as I don't have to give up my favorite IDE either. Sticky this or update it in the wiki.

One question though, does the DirectX SDK have to be the November 2008 version or can bzflag compile with the latest version? (march 2009)

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by JeffM » Tue Apr 21, 2009 5:27 am

2.0.x needs the SDK from april 2007 or before.
2.99.x should work with the current sdk.

you also do not need pdcurses if you do not build the "distribution" targets.

liyusen
Private
Private
Posts: 1
Joined: Mon Jun 01, 2009 5:54 am

Re: How to compile BZFlag on Visual C++ 2008

Post by liyusen » Mon Jun 01, 2009 9:04 am

hi all,
I compiled the source code versions: 2.0.12 according to Yassen's rules and successfully. But I encounter a problem during execution. "MSVCR80.dll" cannot be found. I don't know what is the problem. Thanks.

Anxuiz
Private First Class
Private First Class
Posts: 31
Joined: Fri Sep 05, 2008 3:38 am

Re: How to compile BZFlag on Visual C++ 2008

Post by Anxuiz » Mon Jun 01, 2009 2:49 pm

liyusen wrote:hi all,
I compiled the source code versions: 2.0.12 according to Yassen's rules and successfully. But I encounter a problem during execution. "MSVCR80.dll" cannot be found. I don't know what is the problem. Thanks.
You need glew32.dll, libcurl.dll, msvcr80.dll, MSVC80.dll, MSVCR80.dll, and pdcurses.dll (if you built with curses).

You can find all those dll's except for the msv* dll's in the packages that you got them from (GLEW for glew.dll, LibCURL for libcurl.dll, and PDCurses for pdcurses.dll). They'll be in the lib folder or c:/WINDOWS. Also, you could just get them from a packaged version.

For the msv* dll's you can get them from path/to/vc++ installation directory/VC/redist/x86/Microsoft.VC90.CRT as specified in the redist.txt file located in your installation directory.

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Mon Jun 01, 2009 4:02 pm

"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

trpted
Private First Class
Private First Class
Posts: 162
Joined: Mon Feb 21, 2005 8:29 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by trpted » Tue Sep 08, 2009 1:59 pm

It is complaining that it
]can not find zib1.dll, please reinstall the program
What do I need to do?

Thanks.

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Wed Sep 09, 2009 2:41 am

You need to download the zlib package from where you got curl, and copy that file over to where you're running bzflag/bzfs/bzadmin from.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

trpted
Private First Class
Private First Class
Posts: 162
Joined: Mon Feb 21, 2005 8:29 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by trpted » Wed Sep 09, 2009 2:31 pm

blast wrote:You need to download the zlib package from where you got curl, and copy that file over to where you're running bzflag/bzfs/bzadmin from.
To the best of my knowledge: I did what the OP (original poster) said, and I got that error.

Please explain, what I need to do step by step.

Thanks.

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Wed Sep 09, 2009 8:46 pm

1) Download the zlib package from where you got curl ( http://curl.haxx.se/download.html ) and extract it
2) Copy that file (the one you are missing) over to where you're running bzflag/bzfs/bzadmin from
3) ????
4) PROFIT!!
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

trpted
Private First Class
Private First Class
Posts: 162
Joined: Mon Feb 21, 2005 8:29 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by trpted » Thu Sep 10, 2009 8:20 pm

blast wrote:1) Download the zlib package from where you got curl ( http://curl.haxx.se/download.html ) and extract it
2) Copy that file (the one you are missing) over to where you're running bzflag/bzfs/bzadmin from
3) ????
4) PROFIT!!
I like to play BZFlag and other computer games, but please: You need to stop playing around..

#1 I went to http://curl.haxx.se/download.html as you told me to.

#2 I looked around for the zlib package, but I found the zlib binary packages.

Since I am on Windows, I clicked on the link to Windows GnuWin32 project.

That redirected me to http://sourceforge.net/projects/gnuwin32/files/

I did download some files, but I have no idea of which one that I need.

I downloaded sed-4.2-1-bin.zip and sed-4.2-1-setup.exe.

and I unzipped / extracted, the sed-4.2-1-bin.zip.

I looked every where what was in sed-4.2-1-bin.zipfor zib1.dll and I can't find it.

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: How to compile BZFlag on Visual C++ 2008

Post by joevano » Thu Sep 10, 2009 9:07 pm

Why would you download 'sed' binaries from the GnuWin32 project page and expect to find 'zlib' in it? Download the zlib binaries from the GnuWin page (Last packages on the page) and guess what zlib1.dll is there... AMAZING ;)
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

trpted
Private First Class
Private First Class
Posts: 162
Joined: Mon Feb 21, 2005 8:29 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by trpted » Fri Sep 11, 2009 12:24 am

joevano wrote:Why would you download 'sed' binaries from the GnuWin32 project page and expect to find 'zlib' in it?
Because I wanted to download the most to date files, and that site said these files are the newest..

As to why: Because the newest, usually, contain security fixes (or other fixes) that make it more secure / stable then the older versions..
joevano wrote:Download the zlib binaries from the GnuWin page (Last packages on the page) and guess what zlib1.dll is there... AMAZING ;)
Thank you, it worked. :)

For every one else, who may need to know... The zlib-1.2.3-bin.zip file. After unzipping, in the bin directory.

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: How to compile BZFlag on Visual C++ 2008

Post by joevano » Fri Sep 11, 2009 1:20 am

Yes, I understand wanting the newest files. I was just giving you a hard time. You are from a windows environment so sed and zlib mean nothing to you. To put your situation into the perspective of a linux user on Windows, it would be like me downloading Notepad++ when I was actually looking for WinZip (kinda sorta). :D
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Fri Sep 11, 2009 2:08 pm

If you're compiling, you should have some idea of what you're doing and be able to work things out like "hmm, a missing file. Wonder what I need to do."
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

SkindupTruk
Private First Class
Private First Class
Posts: 19
Joined: Fri Apr 11, 2008 10:17 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by SkindupTruk » Fri Feb 05, 2010 12:03 pm

hi there,

i can fully compile 2.0.x above, and the simplestats plugin once jeffm fixed it for me :) but then i found that bzfs.exe does not run if you build it using the latest compiler and that 2.99 might work

i am now trying 2.99 and i only see the build options for "debug / MX, and release / MX" no redist? when i installed dx mar 09 i only chose header / lib and not redist is that the problem or does the bzflag.sln not have these options?

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Fri Feb 05, 2010 3:55 pm

Only the fullbuild.sln file has the release targets, since that is the one that will build the plugins.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by JeffM » Fri Feb 05, 2010 5:38 pm

yes, the distribution options were put into the only solution that builds all of the distribution files. This was to make building a package simpler, instead of having to go and build the plug ins manually.

cFoo
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 13, 2010 6:21 am

Re: How to compile BZFlag on Visual C++ 2008

Post by cFoo » Sun Feb 14, 2010 5:08 am

I'm getting "The ordinal 55 could not be located in the dynamic link library zlib1.dll" - any idea?

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by blast » Sun Feb 14, 2010 4:15 pm

That would mean you're using the wrong zlib dll. Use the one they have posted on the curl page.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

cFoo
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 13, 2010 6:21 am

Re: How to compile BZFlag on Visual C++ 2008

Post by cFoo » Sun Feb 14, 2010 5:56 pm

Thanks blast! that did the trick. I had an old zlib1.dll that was installed by Mathlab.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: How to compile BZFlag on Visual C++ 2008

Post by JeffM » Sun Feb 14, 2010 11:38 pm

v2.0.14 has been updated with projets for VC 2008. The simplest way to build it is to do the following.
  • Get 2.99.x from the source tree ( see SVN in the wiki for more help)
  • Build it using the release target. This will make some of the libs that arn't included with 2.0.x
  • Grab the CURL and glew lib files from it and throw em into the VC9 folder for 2.0.14
  • Do the same with the CURL and GL include folders
  • If you want to build BZAdmin with pdcurses, get the "pdc34dll.zip" file from here, https://sourceforge.net/projects/pdcurses/files/ and throw it's lib and h files into the VC9 dir
  • Build BZFlag from the bzflag.sln file in the 2.0.14 Win32/VC9 folder, pick ether "release" or "release pdcurses" as the build target.
  • Put the curl, glew, and pdcurses dll's in the root level of the source tree ( where the .exe files are ).
  • Run.
If you wish to build debug, then use the debug target and set the debug command to point to the exe that is in the root ( not "build target") and set the working dir to the source root.

That's it.

catcha
Private First Class
Private First Class
Posts: 22
Joined: Tue Nov 17, 2009 8:24 pm

Re: How to compile BZFlag on Visual C++ 2008

Post by catcha » Fri Feb 26, 2010 11:28 am

JeffM wrote:v2.0.14 has been updated with projets for VC 2008. The simplest way to build it is to do the following.
Thank you very much for these instructions. I'm sorry, but for really simple people (like me), I'd still recommend the Yassen's excellent detailed instructions above.
  • Get 2.99.x from the source tree ( see SVN in the wiki for more help)
Ok, the page is: http://my.bzflag.org/w/SVN. The most important part was to download and install the tortoise svn, right-click and "SVN checkout" on the folder where you want to download the bzflag (from now on, PATH_TO_BZFLAG_SVN), and then put the following address into SVN root: https://bzflag.svn.sourceforge.net/svnr ... lag/trunk/ .
  • Build it using the release target. This will make some of the libs that arn't included with 2.0.x
Done (however, I had to download and install the directX SDK and add this to the MSVC++ path, see the instructions above).
  • Grab the CURL and glew lib files from it and throw em into the VC9 folder for 2.0.14
"Grab" from where? I found just the following .lib file:
  • PATH_TO_BZFLAG_SVN\bzflag\src\other\glew\lib\glew32s.lib
  • Do the same with the CURL and GL include folders
And these could be found here (one has to be sure to copy the FOLDERS, not files under the folders):
  • PATH_TO_BZFLAG_SVN\bzflag\src\other\curl\include\curl
  • PATH_TO_BZFLAG_SVN\bzflag\src\other\glew\include\GL
  • Build BZFlag from the bzflag.sln file in the 2.0.14 Win32/VC9 folder, pick ether "release" or "release pdcurses" as the build target.
Done, after downloading/copying curses.
  • Put the curl, glew, and pdcurses dll's in the root level of the source tree ( where the .exe files are ).
Again, there's no glew.dll or anything like that to "grab".
  • Run.
After I've copied the glew.dll and curl.lib from elsewhere, I get the following error for admin: "LIBC.lib not found".

This is solved by changing the compiler code generation option from to "Multi-threaded (/MT)", but then I get the error: "..\..\src\bzadmin\CursesUI.cxx(33) : error C3861:
'use_default_colors': identifier not found".
"There's no such thing as stupid questions. There's just stupid people." - Mr. Garrison

Post Reply