Board index FlightGear Support Compiling

compiling Flightgear under windows using cmake  Topic is solved

Building FlightGear from source, and in the need for help?

compiling Flightgear under windows using cmake

Postby chandraharika » Mon Jun 23, 2014 12:45 pm

I want to know how to build flightgear project in visual studio using cmake.What are the additional projects required to build Flightgear project.
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby Hooray » Mon Jun 23, 2014 12:52 pm

Hi & welcome,

I'd suggest to check out the wiki, e.g.: http://wiki.flightgear.org/Building_using_CMake#Windows
You will find that the Superbuild is probably the most straightforward option.
Feel free to report back, or ask more specific questions.

BTW: It's OpenSceneGraph, OpenAL, SimGear and FlightGear - along with a few dependencies like boost
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11949
Joined: Tue Mar 25, 2008 8:40 am

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Wed Jun 25, 2014 10:44 am

I tried to build the project using superbuild by following this link http://wiki.flightgear.org/Superbuild. i created the solution file using cmake.while building the solution in visual studio 2010 I am getting error as "error MSB6006: "cmd.exe" exited with code 1".
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby Saga » Wed Jun 25, 2014 2:36 pm

Hi!

The indicated error just say there's an error with the pre build script.
Can you give us the entire output? It could be an unsolved dependency, a download error of the 3rd party libraries, a missing software such as svn, ...
Host and maintainer of fgcom.flightgear.org.
Saga
 
Posts: 69
Joined: Tue Mar 04, 2014 2:52 pm
Location: Loire-Atlantique, France
Callsign: F-G0z
Version: Git next
OS: Win7, ArchLinux x64

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Thu Jun 26, 2014 5:13 am

This is the output that I got.

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: WinDeps, Configuration: Debug Win32 ------
3>------ Build started: Project: Boost, Configuration: Debug Win32 ------
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
4>------ Build started: Project: OSG, Configuration: Debug Win32 ------
4>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
5>------ Build started: Project: SimGear, Configuration: Debug Win32 ------
5>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
6>------ Build started: Project: FGRun, Configuration: Debug Win32 ------
7>------ Build started: Project: FlightGear, Configuration: Debug Win32 ------
6>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
7>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
8>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
8>Project not selected to build for this solution configuration
========== Build: 2 succeeded, 5 failed, 0 up-to-date, 1 skipped ==========
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby Saga » Thu Jun 26, 2014 7:18 am

That's a shame, MSVC doesn't give enough informations. Can you create again the solution with cmake and post the first release build output? Maybe the problem is indicated when the workspace is set up.
Host and maintainer of fgcom.flightgear.org.
Saga
 
Posts: 69
Joined: Tue Mar 04, 2014 2:52 pm
Location: Loire-Atlantique, France
Callsign: F-G0z
Version: Git next
OS: Win7, ArchLinux x64

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Thu Jun 26, 2014 2:15 pm

I built the project again, with cmake and tried to run in visual studio in release mode .output is as follows:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: WinDeps, Configuration: Release Win32 ------
3>------ Build started: Project: Boost, Configuration: Release Win32 ------
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
4>------ Build started: Project: OSG, Configuration: Release Win32 ------
4>LINK : fatal error LNK1104: cannot open file 'C:\fgmeta\metabuild\osgbuild\bin\osg100-osg.dll' [C:\fgmeta\metabuild\osgbuild\src\osg\osg.vcxproj]
4>LINK : fatal error LNK1104: cannot open file 'C:\fgmeta\metabuild\osgbuild\bin\osg100-osg.dll' [C:\fgmeta\metabuild\osgbuild\src\osg\osg.vcxproj]
3>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
5>------ Build started: Project: SimGear, Configuration: Release Win32 ------
5>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
6>------ Build started: Project: FGRun, Configuration: Release Win32 ------
7>------ Build started: Project: FlightGear, Configuration: Release Win32 ------
6>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
7>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
8>------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ------
8>Project not selected to build for this solution configuration
========== Build: 1 succeeded, 6 failed, 0 up-to-date, 1 skipped ==========
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby rreiter » Fri Jun 27, 2014 2:11 am

chandraharika wrote in Thu Jun 26, 2014 2:15 pm:I built the project again, with cmake and tried to run in visual studio in release mode .output is as follows:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
...

It's been a while since I built the 32-bit one but I just did a fresh clean pull, cmake and then build in 64-bit 2 nights ago (same night as your first post) and I know that works.
I will try try 32-bit on the weekend to see if I can duplicate your issue.

In the meantime, You might try 64-bit if you have 64-bit windows+64-bit compiler.

I don't see any indications that windeps or OSG are/were downloading, and I assume it never got that far previously, so whatever you have is probably corrupt now.
You can try clearing out your metabuild folder so that the only thing that's left in it is an empty [install folder].
You might also consider getting a complete fresh fgmeta.

Although it may not always be necessary, in your fgmeta it might help to manually go into [fgrun], [flightgear], [simgear] one at a time and make sure in each that git is on <next> and if not then perform git checkout next (in each).

Then repeat the windows superbuild steps starting at the step that reads "Run the CMake GUI, and select C:\FGFS\fgmeta as the source dir, and C:\FGFS\metabuild as the build dir."
When running cmake pick the 64-bit compiler rather than 32-bit when it asks.

Finally, if you do get to the point where you open FlightGear-Meta.sln, immediately switch the build configuration to release mode before building (your earlier attempt looks like you were in debug-mode).
Let me know which, if any of this helps you so I can add to the wiki anything that's relevant.

If it fails again, please post the compiler output same as before.
Also, please post your system specs and msvc build version +service pack info.

As I said earlier, I'll try the 32-bit myself on the weekend to see what happens.
rreiter
 
Posts: 35
Joined: Thu Jan 16, 2014 4:33 am
Location: Newmarket, Ontario Canada
OS: Windows

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Fri Jun 27, 2014 11:08 am

I tried in release mode only.the process I have followed to build the project is as follows:

1.Downloaded the git extension.

2.in git extension opened clone repository and in repository to clone option I gave command "git://gitorious.org/fg/fgmeta.git" (suggested by superbuild).

3.It created a folder fgmeta containing simgear flightgear openscene graph etc.

4.Using CMAKE I created solution file.

5.Than from visual studio 2010 I tried to build project in release mode.

I am using windows 7 service pack 1.
I will try on 64 bit window. Waiting for you to successfully build the project on 32-bit system :)
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby Saga » Fri Jun 27, 2014 11:39 am

With the program you mentioned (git extension), did you have recursively cloned the fgmeta repository? To check it, do the folders of the submodules (flightgear, simgear) contain files or are they empty?

Personally I use msysgit and VS 2012 (but I don't recommend it). I advice you to try with a CLI (Command Line Interface) git even with Windows (it will be instructive :)) and to follow step by step the tutorial:
git clone --recursive git://gitorious.org/fg/fgmeta.git
git checkout next (in the fgmeta repertory created)

Did you have installed svn and is its location present in the environment PATH variable? To check that, type 'svn' in cmd.exe.
Last edited by Saga on Fri Jun 27, 2014 11:48 am, edited 1 time in total.
Host and maintainer of fgcom.flightgear.org.
Saga
 
Posts: 69
Joined: Tue Mar 04, 2014 2:52 pm
Location: Loire-Atlantique, France
Callsign: F-G0z
Version: Git next
OS: Win7, ArchLinux x64

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Fri Jun 27, 2014 11:47 am

I did not use any --recursive command to clone the data but the folders are not empty it contains the source code.I installed svn and in CMAKE I added path for svn. I don't have any idea about CLI git. I will try this CLI git.
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby chandraharika » Fri Jun 27, 2014 2:27 pm

As suggested I tried with "git clone --recursive git://gitorious.org/fg/fgmeta.git" on msysgit VS2010 . In release mode I tried to build flightgear and the part of output is as follows:

-- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
6> -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
6> -- Could NOT find osgParticle (missing: OSGPARTICLE_LIBRARY OSGPARTICLE_INCLUDE_DIR)
7> -- Could NOT find Git (missing: GIT_EXECUTABLE)
6> -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
7> -- 3rdparty files located in C:/Users/TCS/fgfs/metadata
7> -- BOOST_ROOT is C:/Users/TCS/fgfs/metadata/src/Boost
6> -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR)
6> -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
7> -- Boost version: 1.54.0
6> -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR)
6> -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)
7> -- Found ZLIB: C:/Users/TCS/fgfs/metadata/3rdParty/lib/zlib.lib (found version "1.2.8")
6> CMake Error at C:/Program Files/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
6> Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
6> OPENSCENEGRAPH_INCLUDE_DIR OSGTEXT_FOUND OSGDB_FOUND OSGPARTICLE_FOUND
6> OSGUTIL_FOUND OSGVIEWER_FOUND OSGGA_FOUND OSG_FOUND OPENTHREADS_FOUND)
6> (Required is at least version "2.8.1")
6> Call Stack (most recent call first):
6> C:/Program Files/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
6> C:/Program Files/CMake/share/cmake-3.0/Modules/FindOpenSceneGraph.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
6> CMakeLists.txt:144 (find_package)
6>
6>
6> -- Configuring incomplete, errors occurred!
6> See also "C:/Users/TCS/fgfs/metadata/fgrunbuild/CMakeFiles/CMakeOutput.log".
6>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
7> -- Looking for include file pthread.h
7> -- Looking for include file pthread.h - not found
7> -- Found Threads: TRUE
7> -- Found OpenGL: opengl32
7> -- Found OpenAL: C:/Users/TCS/fgfs/metadata/3rdParty/lib/OpenAL32.lib
7> -- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
7> -- Could NOT find osgSim (missing: OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR)
7> -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
7> -- Could NOT find osgParticle (missing: OSGPARTICLE_LIBRARY OSGPARTICLE_INCLUDE_DIR)
7> -- Could NOT find osgFX (missing: OSGFX_LIBRARY OSGFX_INCLUDE_DIR)
7> -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
7> -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR)
7> -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
7> -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR)
7> -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)
7> CMake Error at C:/Program Files/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
7> Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
7> OPENSCENEGRAPH_INCLUDE_DIR OSGTEXT_FOUND OSGSIM_FOUND OSGDB_FOUND
7> OSGPARTICLE_FOUND OSGFX_FOUND OSGUTIL_FOUND OSGVIEWER_FOUND OSGGA_FOUND
7> OSG_FOUND OPENTHREADS_FOUND) (Required is at least version "3.2.0")
7> Call Stack (most recent call first):
7> C:/Program Files/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
7> C:/Program Files/CMake/share/cmake-3.0/Modules/FindOpenSceneGraph.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
7> CMakeLists.txt:221 (find_package)
7>
7>
7> -- Configuring incomplete, errors occurred!
7> See also "C:/Users/TCS/fgfs/metadata/fgbuild/CMakeFiles/CMakeOutput.log".
7> See also "C:/Users/TCS/fgfs/metadata/fgbuild/CMakeFiles/CMakeError.log".
7>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
8>------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ------
8>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 4 failed, 0 up-to-date, 1 skipped ==========
chandraharika
 
Posts: 16
Joined: Wed Jun 18, 2014 11:32 am

Re: compiling Flightgear under windows using cmake

Postby poweroftwo » Fri Jun 27, 2014 2:54 pm

Flightgear / simgear Cmake's are surprisingly sensitive to having dependencies in relative path proximity. The wiki shows it here: http://wiki.flightgear.org/Building_using_CMake_-_Windows

I recently struggled with it quite a bit when producing this simple script to build Flightgear with osgEarth integrated. You might find it useful in setting up your build.

http://forum.flightgear.org/viewtopic.php?f=6&t=23404#p213447

jeff
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: compiling Flightgear under windows using cmake

Postby Saga » Fri Jun 27, 2014 3:14 pm

I see you use the new version of CMake. Can you try with the last 2.x version of CMake. Maybe there is something to fix in fgmeta. I will check that more later whether I have the same issue with this version of CMake.

Is the SP1 update for VS2010 is installed?

Otherwise, the problem seems to be arround Git. Your logs says Git and OSG cannot be found. I believe OSG is downloaded with the git clone command. It seems git location is not present in your PATH environment variable. if you type 'git' in cmd.exe and not the git bash program included in msysgit, is something like "usage: git..." is displayed?

EDIT: With CMake 3.0 I experience the same problem and with the last commit d498ebb (fgmeta). I'm building again but with CMake 2.8.12 this time to check whether the problem is due to 3.0.
Host and maintainer of fgcom.flightgear.org.
Saga
 
Posts: 69
Joined: Tue Mar 04, 2014 2:52 pm
Location: Loire-Atlantique, France
Callsign: F-G0z
Version: Git next
OS: Win7, ArchLinux x64

Re: compiling Flightgear under windows using cmake

Postby rreiter » Sat Jun 28, 2014 6:22 pm

Saga wrote in Fri Jun 27, 2014 3:14 pm:I see you use the new version of CMake. Can you try with the last 2.x version of CMake. Maybe there is something to fix in fgmeta. I will check that more later whether I have the same issue with this version of CMake.

For reference, I erased everything (I mean everything) and then followed the windows superbuild instructions from scratch to clone fgmeta (command-line git), then run cmake 2.8.12.2, then Win32 release build of Flightgear-meta.sln using MSVS Express.
Worked great:
7> Completed 'FlightGear'
8>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
8> Building Custom Rule W:/homevs/fgmeta/CMakeLists.txt
8> CMake does not need to re-run because W:\homevs\metabuild\CMakeFiles\generate.stamp is up-to-date.
8> Build all projects
========== Build: 8 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

System: Win 8.1/64,
Software
:
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel, Microsoft .NET Framework Version 4.5.51641 SP1Rel
Installed Version: VC Express Microsoft Visual C++ 2010 01013-169-2610014-70682
Hotfix for Microsoft Visual C++ 2010 Express - ENU (KB2565057) KB2565057
Hotfix for Microsoft Visual C++ 2010 Express - ENU (KB2635973) KB2635973
Microsoft Visual C++ 2010 Express - ENU Service Pack 1 (KB983509) KB983509

Git: command-line interface git bash 1.8.4-preview20130916
CMAKE: Cmake2.8.12.2 3.0.0
SVN: Apache Subversion 1.8.5

-----------------------------------

I'll will also try this again later using the newer cmake just to see if that's is the problem.
In the meantime, chandraharika, you may want to use the older version of CMAKE as suggested above...

Edit: I have good news and bad news.
The good news is that it also built ok from scratch as above but using Cmake 3.0.0 ; the bad news is that if it still won't build for you after you erase everything and start from scratch and carefully follow all the steps, your problem likely lies elsewhere.
Last edited by rreiter on Sat Jun 28, 2014 8:52 pm, edited 2 times in total.
rreiter
 
Posts: 35
Joined: Thu Jan 16, 2014 4:33 am
Location: Newmarket, Ontario Canada
OS: Windows

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest