This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

Compiling: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
No edit summary
Zehra (talk | contribs)
we got official documentation covering it
 
(41 intermediate revisions by 15 users not shown)
Line 1: Line 1:
==Overview==
BZFlag is well supported on 3 major operating systems. (Please consult with other platform specific readme's, if available, otherwise consult general build instructions.)
Compiling BZFlag is the act of taking the raw source codes for the game and using tools to build an executable application(s) for a target system.


==Source Code==
{|{{Prettytable}}
In order to compile a user must have his or her own copy of the [[BZFlag_Source|Source Code]]. The code can be obtained from a source archive from the [[Downloads]] page, or from the [[BZFlag_SVN]] server.
|-
| {{Hl3}} |'''Operating System:'''
|-
| [https://www.bzflag.org/documentation/developer/compiling/windows/ Windows]
|-
| [https://www.bzflag.org/documentation/developer/compiling/linux/ Linux]
|-
| [https://www.bzflag.org/documentation/developer/compiling/macos/ macOS]
|-
|}


==Readme Files==
=Compiling Misc:=
Users should always read the README files for the appropriate operating system. These files are located in the root directory of the source code tree.
==Simple plugin compiling==
Simple bash script which can sometimes simplify writing very basic plugins.


==Compilers==
'''plugin.sh'''
BZFlag is capable of being built on a number of compilers. The compiler used will depend in some way on the operating system of the computer doing the build.
#!/bin/bash
compiler="g++"
options="-I "
headers="/path/to/bzflag/include"
options2="-fPIC -shared -o"
$compiler $options $headers $options2 $1.so $1.cpp
Compile a plugin with:
./plugin.sh myPlugin.cpp


Linux computers, use the GCC compiler.
==Simple [[Modeltool|modeltool]] compiling==
Macintosh Computers use the XCode compiler
This usual covers building modeltool on recent releases:
Windows Computers can use the Visual C++ compiler, or the MinGW compiler (based on GCC)
g++ -o modeltool modeltool.cxx -include SimpleTextUtils.h model.h wavefrontOBJ.h Q3BSP.h Q3BSP.cxx wavefrontOBJ.cxx SimpleTextUtils.cxx
 
===GCC===
The GCC build as a number of requirements;
* Automake X.XX
* Autoconf X.XX
* Autotools X.XX
* SDL Development libraries 1.2.10 or greater
* OpenGL Development libraries 1.1 or greater
 
If the required dependencies are installed, the user must then run the following commands from at root level of the source tree
 
  ./autogen.sh
  ./configure
  ./make
  ./make install
 
Please note that depending on permissions levels the '''make install''' command may need to be run as an administrator or root.
 
===XCode===
Click and be happy ( someone fill this in with real info that is correct ).
 
===Visual C++===
 
==== 2.0.x ====
 
==== 2.99.x =====
 
===Other build systems===
Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..)




[[Category:Development]]
[[Category:Development]]
[[Category:Compiling]]
[[Category:Compiling]]
[[Category:Tutorials]]

Latest revision as of 02:07, 10 November 2025

BZFlag is well supported on 3 major operating systems. (Please consult with other platform specific readme's, if available, otherwise consult general build instructions.)

Operating System:
Windows
Linux
macOS

Compiling Misc:

Simple plugin compiling

Simple bash script which can sometimes simplify writing very basic plugins.

plugin.sh

#!/bin/bash
compiler="g++"
options="-I "
headers="/path/to/bzflag/include"
options2="-fPIC -shared -o"
$compiler $options $headers $options2 $1.so $1.cpp

Compile a plugin with:

./plugin.sh myPlugin.cpp

Simple modeltool compiling

This usual covers building modeltool on recent releases:

g++ -o modeltool modeltool.cxx -include SimpleTextUtils.h model.h wavefrontOBJ.h Q3BSP.h Q3BSP.cxx wavefrontOBJ.cxx SimpleTextUtils.cxx