Page 1 of 2

How to compile BZFlag on Visual C++ 2008

Posted: Sat Feb 07, 2009 9:25 pm
by Anxuiz
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!

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

Posted: Sat Feb 07, 2009 9:26 pm
by Anxuiz
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!

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

Posted: Sat Feb 07, 2009 10:29 pm
by blast
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.

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

Posted: Tue Apr 21, 2009 1:42 am
by angryfirelord
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)

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

Posted: Tue Apr 21, 2009 5:27 am
by JeffM
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.

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

Posted: Mon Jun 01, 2009 9:04 am
by liyusen
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.

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

Posted: Mon Jun 01, 2009 2:49 pm
by Anxuiz
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.

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

Posted: Mon Jun 01, 2009 4:02 pm
by blast

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

Posted: Tue Sep 08, 2009 1:59 pm
by trpted
It is complaining that it
]can not find zib1.dll, please reinstall the program
What do I need to do?

Thanks.

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

Posted: Wed Sep 09, 2009 2:41 am
by blast
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.

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

Posted: Wed Sep 09, 2009 2:31 pm
by trpted
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.

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

Posted: Wed Sep 09, 2009 8:46 pm
by blast
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!!

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

Posted: Thu Sep 10, 2009 8:20 pm
by trpted
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.

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

Posted: Thu Sep 10, 2009 9:07 pm
by joevano
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 ;)

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

Posted: Fri Sep 11, 2009 12:24 am
by trpted
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.

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

Posted: Fri Sep 11, 2009 1:20 am
by joevano
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

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

Posted: Fri Sep 11, 2009 2:08 pm
by blast
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."

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

Posted: Fri Feb 05, 2010 12:03 pm
by SkindupTruk
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?

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

Posted: Fri Feb 05, 2010 3:55 pm
by blast
Only the fullbuild.sln file has the release targets, since that is the one that will build the plugins.

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

Posted: Fri Feb 05, 2010 5:38 pm
by JeffM
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.

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

Posted: Sun Feb 14, 2010 5:08 am
by cFoo
I'm getting "The ordinal 55 could not be located in the dynamic link library zlib1.dll" - any idea?

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

Posted: Sun Feb 14, 2010 4:15 pm
by blast
That would mean you're using the wrong zlib dll. Use the one they have posted on the curl page.

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

Posted: Sun Feb 14, 2010 5:56 pm
by cFoo
Thanks blast! that did the trick. I had an old zlib1.dll that was installed by Mathlab.

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

Posted: Sun Feb 14, 2010 11:38 pm
by JeffM
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.

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

Posted: Fri Feb 26, 2010 11:28 am
by catcha
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".