Need some help to compile Stratagus

Asked by ULIT JAIDEE on 2012-11-07

Hello everyone,

I tried myself to compile Stratagus, but I had no luck.
I think I do anything as the page (http://stratagus.com/install.shtml) told me what to do.
However, I got a lot of compile errors.
If I anyone can help me, I am very appreciative.

Ulit
(<email address hidden>)

Question information

Language:
English Edit question
Status:
Open
For:
Stratagus Edit question
Assignee:
Bradley Clemetson Edit question
Last query:
2012-11-14
Last reply:
2012-11-08
Bradley Clemetson (brad-c6) said : #1

What operating system are you using?
what are the compile errors?

ULIT JAIDEE (ulj208) said : #2

I use Windows 7.
The compile errors are:

make: CXX@: Command not found
make: *** [src/action/@OBJDIR@/action_attack.o] Error 127

ULIT JAIDEE (ulj208) said : #3

By the way, I use NetBean IDE to compile.
What IDE should l use to compile the code?
Thank you.

Bradley Clemetson (brad-c6) said : #4

The first problem I think is that the stratagus.com site is very old and out of date (Check the ones under the "doc/install.html".) You will probably want to install the Cmake & MinGW and maybe Visual Studio 2012 Express Desktop Edition.

1.Ensure all the libraries are installed correctly (Deps)
2.Open minGW and navigate to the root project folder
3. Create a "build" directory "mkdir build"
4.Run cmake to generate the correct makefiles "cmake .."
5.Compile the result "cmake .."

That should create a stratagus.exe file

Sorry I can't help you specifically yet as I use Ubuntu & OSX mostly, but I will work it out with you :)
We also have pre-built binaries if you would like to simply run it directly on the right hand side of the downloads bar
(https://launchpad.net/stratagus)

Joris Dauphin (joris-dauphin) said : #5

http://stratagus.com/install.shtml updated.
(we have 4 copies on this page, and the web one hasn't been updated... sorry).

I don't use CMake with NetBean, but it seems to be possible according to a quick search on google.

ULIT JAIDEE (ulj208) said : #6

Thank you so much guy.

How I can ensure that I installed all the libraries below correctly?
  1. CMake ----> I think this one I have installed it correctly.
  2. SDL
  3. libpng
  4. zlib
  5. Lua 5.1 ----> I think this one I have installed it correctly.
  6. Tolua++

Thank you in advance for your answers.

ULIT JAIDEE (ulj208) said : #7

Thank you for the replies.
I still cannot figure out how to compile it.
It is very complicate for me.

Could possibly someone give me the zip file of Visual C++ project of the Stratagus?
So I believe I can finally compile it.

my email: <email address hidden>

Thank you guys.

Joris Dauphin (joris-dauphin) said : #8

In the install page, there is a zip with all lib for msvc.
once unzipped, you run:
cmake.exe -DENABLE_STATIC=ON -G"Visual Studio 10" -DCMAKE_PREFIX_PATH=c:/path/to/3rd/
then you can compile with msvc.
If you have some error, report here.

ULIT JAIDEE (ulj208) said : #9

Thank you so much.
This is the error after I ran the command:
cmake.exe -DENABLE_STATIC=ON -G"Visual Studio 10" -DCMAKE_PREFIX_PATH=c:/path/to/3rd/

CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 10".
CMAKE_MAKE_PROGRAM is not set.
You probably need to select a different build tool.
CMake Error: Could not find cmake module file:C:/NetBeansProjects/stratagus_2.2.7.orig/CMakeFiles/2.8.10.1/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:C:/NetBeansProjects/stratagus_2.2.7.orig/CMakeFiles/2.8.10.1/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!

I have Visual Studio 2012 and Visual C++ 2005.
Do I need to have Visual Studio 10?

Thank you very much again.

Joris Dauphin (joris-dauphin) said : #10

in http://www.cmake.org/cmake/help/v2.8.10/cmake.html#section_Generators

I don't see VS2012, you may test VS2011 generator maybe.

else, choose any supported IDE.

Pali (pali) said : #11

run:
cmake --help
it will show all available generators

ULIT JAIDEE (ulj208) said : #12

Hi guys,
Thank you for all responds.

I already installed Visual Studio 2010.
And, here is the result and errors after I used cmake.exe

C:\NetBeansProjects\stratagus_2.2.7.orig>cmake.exe -DENABLE_STATIC=ON -G"Visual Studio 10" -DCMAKE_PREFIX_PATH=c:/path/to/3rd/
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/NetBeansProjects/stratagus_2.2.7.orig/CMakeFiles/CMakeTmp

  Run Build Command:C:\PROGRA~2\MICROS~3.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec1096634593

  Microsoft (R) Visual Studio Version 10.0.30319.1.

  Copyright (C) Microsoft Corp. All rights reserved.

  1>------ Build started: Project: cmTryCompileExec1096634593, Configuration:
  Debug Win32 ------

  1>Build started 11/10/2012 2:40:30 AM.

  1>PrepareForBuild:

  1> Creating directory "C:\NetBeansProjects\stratagus_2.2.7.orig\CMakeFiles\CMakeTmp\Debug\".

  1>InitializeBuildStatus:

  1> Creating "cmTryCompileExec1096634593.dir\Debug\cmTryCompileExec1096634593.unsuccessfulbuild" because "AlwaysCreate" was specified.

  1>ClCompile:

  1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86

  1> Copyright (C) Microsoft Corporation. All rights reserved.

  1>

  1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
  "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
  /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1096634593.dir\Debug\\"
  /Fd"C:/NetBeansProjects/stratagus_2.2.7.orig/CMakeFiles/CMakeTmp/Debug/cmTryCo
mpileExec1096634593.pdb"
  /Gd /TC /analyze- /errorReport:prompt testCCompiler.c /Zm1000

  1>

  1> testCCompiler.c

  1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

  1>

  1>Build FAILED.

  1>

  1>Time Elapsed 00:00:02.85

  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)

-- Configuring incomplete, errors occurred!

Any help, I am very appreciative.

ULIT JAIDEE (ulj208) said : #13

I also have Visual Studio 11 installed in my computer.
And, here is the result after running cmake........

C:\NetBeansProjects\stratagus_2.2.7.orig>cmake.exe -DENABLE_STATIC=ON -G"Visual Studio 11" -DCMAKE_PREFIX_PATH=c:/path/to/3rd/
-- The C compiler identification is MSVC 17.0.50727.1
-- The CXX compiler identification is MSVC 17.0.50727.1
-- Check for working C compiler using: Visual Studio 11
-- Check for working C compiler using: Visual Studio 11 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 11
-- Check for working CXX compiler using: Visual Studio 11 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPkgConfig.cmake:102 (find_package_handle_standard_args)
  CMakeLists.txt:558 (find_package)

-- Configuring incomplete, errors occurred!

I think using Visual Studio 11 is more progress in compiling the cmake command.
Could anyone tell me what I should do next? There are still some errors in the result.
Thank you.

Bradley Clemetson (brad-c6) said : #14

Correct me if I'm wrong but looks like you need to install a program known as pkg-config, you can get it @

http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.26-1_win32.zip

Pali (pali) said : #15

pkgconfig is needed only for maemo. but I forgot to add pkgconfig check into maemo section.

Apply this patch and tell me if it working:

=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-08-31 16:55:27 +0000
+++ CMakeLists.txt 2012-11-11 11:47:57 +0000
@@ -556,10 +556,9 @@ if(UNIX AND CMAKE_SYSTEM_NAME MATCHES BS
  set(BSD true)
 endif()

-find_package(PkgConfig QUIET REQUIRED)
-
 # Check if platform is Maemo
 if(UNIX AND CMAKE_SYSTEM_NAME MATCHES Linux)
+ find_package(PkgConfig QUIET REQUIRED)
  pkg_check_modules(MAEMO_VERSION maemo-version)
  if(MAEMO_VERSION_FOUND)
   set(MAEMO true)

ULIT JAIDEE (ulj208) said : #16

Thank you so much for your help from all of you guys.

I already downloaded the "pkg-config" from the link you give me and extracted it.
However, there are no *.exe files for me to install the program.

Pali, thank you very much.
However, I don't understand what do you want me to do?

"=== modified file 'CMakeLists.txt'
 --- CMakeLists.txt 2012-08-31 16:55:27 +0000
 +++ CMakeLists.txt 2012-11-11 11:47:57 +0000
 .... and so on ......."

Could you please kindly explain to me what do you want me to do?
Do you mean I should delete the file CMakeLists.txt and download the new one with its date 2012-11-11?
If you mean this, could you please give me the link of the new CMakeLists.txt file?

Anyhow, if anyone can compile Stratagus under Windows OS,
could possibly you give me the whole project file?
This is because I believe I will can compile it without any configuration or less configuration.
Thank you so much.

my email address: <email address hidden> or <email address hidden>

Pali (pali) said : #17

Above patch is in unified diff format, which is acceptable by patch program. See wiki about format https://en.wikipedia.org/wiki/Diff#Unified_format

If you do not have patch program installed you can modify file by yourself, format is human readable. Lines which start with '-' are not in new version and line with '+' are in new version.

Joris Dauphin (joris-dauphin) said : #18

Note also that in the command line -DCMAKE_PREFIX_PATH=c:/path/to/3rd/
c:/path/to/3rd has to be replaced by the path where you unzip msvc-lib.zip .

ULIT JAIDEE (ulj208) said : #19

Hi Guys,
I still need your help. I don't have experience much about using cmake.
Here are the errors I got. What should I try next?
Thank you so much for any help your provide.

Is it possible for someone to remote help me with a program like showmypc.com?
I really cannot compile it. It is so complicate for me.
I almost give up now, but I can't because I need to modify it for my ai research.

If someone want to send me a private message, this is my email <email address hidden>

C:\NetBeansProjects\stratagus_2.2.7.orig>cmake.exe -DENABLE_STATIC=ON -G"Visual Studio 11" -DCMAKE_PREFIX_PATH=C:\NetBeansProjects\stratagus_2.2.7.orig\3rd

-- The C compiler identification is MSVC 17.0.50727.1
-- The CXX compiler identification is MSVC 17.0.50727.1
-- Check for working C compiler using: Visual Studio 11
-- Check for working C compiler using: Visual Studio 11 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 11
-- Check for working CXX compiler using: Visual Studio 11 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPkgConfig.cmake:102 (find_package_handle_standard_args)
  CMakeLists.txt:558 (find_package)

-- Configuring incomplete, errors occurred!

Joris Dauphin (joris-dauphin) said : #20

As mentionned by Pali, modify CMakeLists.txt
by removing (around line 556)
-- 8< --
find_package(PkgConfig QUIET REQUIRED)
-- >8 --
and relaunch cmake

Can you help with this problem?

Provide an answer of your own, or ask ULIT JAIDEE for more information if necessary.

To post a message you must log in.