Difference between revisions of "Angband/65\Compiling"

From RogueBasin
Jump to navigation Jump to search
 
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== With Visual C++ (IDE) ==
== With Visual C++ (IDE) ==
The instructions below should give you an optimized, release, version of the game. If you want to compile a debug version make the obvious changes.


* Copy 'angband.ico' into the \src\win directory.
* Copy 'angband.ico' into the \src\win directory.
* Start the VC++ IDE and create a new empty project
* Start the VC++ IDE and create a new empty project in the source directory (a new subfolder will be created)
* Add all the *.c, *.h and *.rc files from the \src directory and the monster, object, player and win subdirectories.
* Add all the *.c, *.h and *.rc files from the \src directory and the monster, object, player and win subdirectories.
* From Project -> Properties -> Linker -> Input set "additional dependencies" to winmm.lib
* (Optional) You can create Monster, Object, Player and Win filters in the previous step instead of putting all the files into one list.  This has the cosmetic benefit of more closely resembling the arrangement of files on the disk.
* From Project -> Properties -> C/C++ -> Advanced set "Compile as" to "Compile as C code /TC"
 
=== Build -> Configuration manager ===
* Set 'configuration' to "Release".
 
=== Project -> Properties ===
* '''Configuration Properties / General''' : Set "output directory" to where you want the .exe (usually ..\..\ ).
* '''C/C++ / General''' : Set additional include directories to the source directory (usually ..\ )
* '''C/C++ / General''' : Set warning level to /W4 (optional).
* '''C/C++ / Advanced''' : Change "Compile as" to "Compile as C code /TC"
* '''C/C++ / Command Line''' : Type "/DWINDOWS /DNDEBUG" into the Command line.
* '''Linker / Input''' : Set "additional dependencies" to winmm.lib


== With Visual C++ (Command prompt) ==
== With Visual C++ (Command prompt) ==
Line 11: Line 23:
* Start Visual C++ Command Prompt
* Start Visual C++ Command Prompt
* Change to source directory
* Change to source directory
* Enter "nmake /fMakefile.nmake"
* Enter "nmake /fMakefile.nmake"  


== With Dev-C++ ==
== With Dev-C++ ==
NOTE: Earlier builds compiled with Dev-C++ were associated with segment fault crashes. Now seems to be OK.
 
NOTE: Earlier builds compiled with Dev-C++ were associated with segment fault crashes. Now seems to be OK.
 
* Create an empty C project, located in the source directory
* Create an empty C project, located in the source directory
* Add every C file from src/, src/win, src/monster, src/object and src/player.
* Add every C file from src/, src/win, src/monster, src/object and src/player.
* From Project -> Project Options, General tab set "Win32 console application"  
* From Project -> Project Options, General tab set "Win32 console application"
* From Project -> Project Options, Build Options tab, set the executable output directory to "..\".
* From Project -> Project Options, Build Options tab, set the executable output directory to "..\".
* From Project -> Project Options, parameters tab, add -mwindows -DWINDOWS -I. to the compiler options and -lmingw32 -lwinmm -mwindows to the linker options.
* From Project -> Project Options, parameters tab, add -mwindows -DWINDOWS -I. to the compiler options and -lmingw32 -lwinmm -mwindows to the linker options.  


== With Linux ==
== With Linux ==


Compiling with Linux should be possible (now that some initial problems have been fixed)Compiling guides, hints, etc. are welcome.
The following works for me.  Your Linux may varyComments, corrections and additions welcome.
 
* The game library and source files are assumed to be in the folder "Angband65" on the desktop.
# Start a terminal window.
# $ cd Desktop/Angband65
# $ autogen.sh
# $ configure --with-noinstall
# $ make
* Now copy the Angband65 executable file into the Angband65 folder from Angband65/src.
 
== Back to project ==
 
[[Angband/65]] main page.
 
[[Category:Angband variants]]

Latest revision as of 01:17, 30 December 2012

With Visual C++ (IDE)

The instructions below should give you an optimized, release, version of the game. If you want to compile a debug version make the obvious changes.

  • Copy 'angband.ico' into the \src\win directory.
  • Start the VC++ IDE and create a new empty project in the source directory (a new subfolder will be created)
  • Add all the *.c, *.h and *.rc files from the \src directory and the monster, object, player and win subdirectories.
  • (Optional) You can create Monster, Object, Player and Win filters in the previous step instead of putting all the files into one list. This has the cosmetic benefit of more closely resembling the arrangement of files on the disk.

Build -> Configuration manager

  • Set 'configuration' to "Release".

Project -> Properties

  • Configuration Properties / General : Set "output directory" to where you want the .exe (usually ..\..\ ).
  • C/C++ / General : Set additional include directories to the source directory (usually ..\ )
  • C/C++ / General : Set warning level to /W4 (optional).
  • C/C++ / Advanced : Change "Compile as" to "Compile as C code /TC"
  • C/C++ / Command Line : Type "/DWINDOWS /DNDEBUG" into the Command line.
  • Linker / Input : Set "additional dependencies" to winmm.lib

With Visual C++ (Command prompt)

  • Start Visual C++ Command Prompt
  • Change to source directory
  • Enter "nmake /fMakefile.nmake"

With Dev-C++

NOTE: Earlier builds compiled with Dev-C++ were associated with segment fault crashes. Now seems to be OK.

  • Create an empty C project, located in the source directory
  • Add every C file from src/, src/win, src/monster, src/object and src/player.
  • From Project -> Project Options, General tab set "Win32 console application"
  • From Project -> Project Options, Build Options tab, set the executable output directory to "..\".
  • From Project -> Project Options, parameters tab, add -mwindows -DWINDOWS -I. to the compiler options and -lmingw32 -lwinmm -mwindows to the linker options.

With Linux

The following works for me. Your Linux may vary. Comments, corrections and additions welcome.

  • The game library and source files are assumed to be in the folder "Angband65" on the desktop.
  1. Start a terminal window.
  2. $ cd Desktop/Angband65
  3. $ autogen.sh
  4. $ configure --with-noinstall
  5. $ make
  • Now copy the Angband65 executable file into the Angband65 folder from Angband65/src.

Back to project

Angband/65 main page.