Board index FlightGear Support Compiling

Compile a custom version of FGv2 for a change in native_fdm

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

Compile a custom version of FGv2 for a change in native_fdm

Postby Rasheed » Fri Jul 29, 2011 9:40 pm

Hello,

I'm running Windows 7 64 bits and FlighGear v2.0.0. I installed fgsetup-2.0.0.exe from http://www.flightgear.org/. The program is running without any problems.
I'm using flightgear as a visualization for aircraft control systems simulations with Matlab 2010b and other computation softwares.

I start flightgear with the following command fgfs --httpd=5502 --fdm=network,localhost,5501,5502,5503 to manipulate the FG's property tree with values from my application. I'm mainly interested in the position parameters and the control surfaces positions. The application sends the values to port 5502 to >localhost.

I'm sending the position values, orientation, velocities, and control surfaces deflections. Almost all the nodes are employed. However, I'm at a point where I need to send more valuesto flightgear that are not a part of the property tree (new properties). For example I need to make a new property under /surface-positions. To do that I had to have a look at the source files of FG (version 2.0.0). The related files lie under scr/Network.

I made some changes in the source file "native_fdm.cxx" and the header file "native_fdm.hxx" to be able to receive the extra values from my application. I also wrote the XML files to create the new nodes in the property tree. With the current installed version of FlightGear v2.0.0 on my PC & the XML files, I can see the new nodes in the property tree by browsing http://localhost:5502.

This is the reason why I need to compile the source files of flightgear with the new changes in native_fdm.hxx, and native_fdm.hxx to have access to the new nodes in the tree.
I went through the instructions on http://wiki.flightgear.org/index.php/Building_FlightGear_-_Windows to get a first idea of what is needed.
I was not able to get Git to connect suceesfuly to gitorious.org or mapserver, and because I don't need to get the cut edge code of FG, I just downloaded the source code files of FlightGear-2.0.0 and SimGear-2.0.0 from
http://ftp.linux.kiev.ua/pub/fgfs/Source/FlightGear-2.0.0.tar.gz and
ftp://mirrors.ibiblio.org/pub/mirrors/simgear/ftp/Source/SimGear-2.0.0.tar.gz

I installed, unzipped, compiled (if necessary) most of the dependancies successfully. Now I have the following directory structure for FlightGear:
C:\FlightGear\boost_1_39_0\
C:\FlightGear\simgear\
C:\FlightGear\simgear\simgear\
C:\FlightGear\install\msvc90\OpenSceneGraph\include\
C:\FlightGear\3rdParty\include\
C:\FlightGear\plib
C:\FlightGear\flightgear

Everything was okay untill I tried to intall and build SimGear. First the website that is used everywhere to point to the source code is not working (i mean http://www.simgear.org) However, I googled for it, and download SimGear-2.0.0.tar.gz and exracted the tar file under c:\FlightGear as I showed above.
I have Visual Studio Professional 2008 installed on the PC. I tried to use it to build Simgear, but I wasn't successful. First I had to download the file named simgear_config.h-msvc90 from gitorious manually because it was not there in the tar file (eventhough the SimGear.vcproj file is there in the projects folder of SimGear)! But even after getting the simgear_config.h, I got many warnings and errors. (SimGear - 18 error(s), 25 warning(s))

Here are all my errors from the Buildlog/Output Window:

c:\flightgear\simgear\simgear\scene\model\sgpagedlod.cxx(70) : error C2027: use of undefined type 'osgDB::DatabasePager'
c:\flightgear\simgear\simgear\scene\model\sgpagedlod.hxx(29) : see declaration of 'osgDB::DatabasePager'
c:\flightgear\simgear\simgear\scene\model\sgpagedlod.cxx(70) : error C2227: left of '->requestNodeFile' must point to class/struct/union/generic type
......
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(55) : error C2039: 'RegisterRenderBinProxy' : is not a member of 'osgUtil'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(55) : error C2146: syntax error : missing ';' before identifier 'clipBinProxy'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2039: 'RegisterRenderBinProxy' : is not a member of 'osgUtil'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2039: 'clipBinProxy' : is not a member of 'SGClipGroup'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(33) : see declaration of 'SGClipGroup'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2146: syntax error : missing ';' before identifier 'clipBinProxy'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2078: too many initializers
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2440: 'initializing' : cannot convert from 'SGClipGroup::ClipRenderBin *' to 'int'
There is no context in which this conversion is possible
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(74) : error C2248: 'SGClipGroup::ClipRenderBin' : cannot access protected class declared in class 'SGClipGroup'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.cxx(37) : see declaration of 'SGClipGroup::ClipRenderBin'
c:\flightgear\simgear\simgear\scene\model\sgclipgroup.hxx(33) : see declaration of 'SGClipGroup'
......
c:\flightgear\simgear\simgear\scene\sky\bbcache.cxx(132) : error C3861: 'gluPerspective': identifier not found
.......
c:\flightgear\simgear\simgear\screen\tr.cxx(569) : error C3861: 'gluProject': identifier not found
BSCMAKE: error BK1506 : cannot open file '.\Win32\Debug\exception.sbr': No such file or directory

I tried hard to review the dependencies and see if I forgot to install something but couldnt solve it, and now I'm stuck at this point.

My question is: Do I really have to compile the whole FlightGear visual studio solution (found in the projects folder in the Flightgear-2.0.0 source code) if I'm just changing few lines in one source file in scr/Network??
> If no, then how do I proceed?
I can see that the FlightGear project in the VS solution contains the two files: native_fdm.cxx and native_fdm.hxx under Lib-Network. But it is depending on the SimGear project and won't compile without having SimGear compiled.

Please advise. I hope I could explain my problem clearly.
I appreciate your help and I thank you for reading the topic.

Thank you for your responses in advance.
Rasheed
Rasheed
 
Posts: 3
Joined: Thu Jul 28, 2011 8:29 am

Re: Compile a custom version of FGv2 for a change in native_

Postby truthsolo » Sat Jul 30, 2011 12:39 am

You do need to compile SimGear before FlightGear. I know you said you don't need the cutting edge, but that wiki is very out of date. If you download the latest sources from git, the updated 3rd-party & OSG, as well as boost 1.44.0, you should have no trouble compiling the latest version under Windows. I have done this myself from scratch and have a good working setup. If you decide to go this route, I can help, but I never did anything with 2.0.

3rd party plugins & OSG 3 can be found here. If you download the git sources, take a read through Flightgear/docs-mini/README.MSVC. It has more up-to-date info than the wiki and should help a lot, as there are a few steps you must do manually before building the solution (I also had to set FlightGear as a dependency of fgpanel, otherwise fgpanel would complain about config.h because it had not been generated yet).

For git, I used: git clone git://gitorious.org/fg/flightgear.git FlightGear ; git clone git://gitorious.org/fg/simgear.git SimGear. If you are unable to download from git, I'd be willing to send you the latest in a tarball; just PM me if you need that.

cheers,

Rob
Rob — IRC: truthsolo — I run mpserver16.flightgear.org (Kansas City, MO) — MP Server Status
Good hunting!
truthsolo
 
Posts: 231
Joined: Sat Feb 12, 2011 2:41 am
Callsign: C-FBAR, Snapper
IRC name: truthsolo
Version: git

Re: Compile a custom version of FGv2 for a change in native_

Postby Johan G » Sat Jul 30, 2011 6:55 pm

truthsolo wrote in Sat Jul 30, 2011 12:39 am:I know you said you don't need the cutting edge, but that wiki is very out of date.

If you find errors in the wiki, and are able to do so and have the time, please correct it. :wink:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5296
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Compile a custom version of FGv2 for a change in native_

Postby truthsolo » Sun Jul 31, 2011 3:30 pm

I may work on it later this week; Sunday is deadline day.. every week.. for the rest of my life. :(
Rob — IRC: truthsolo — I run mpserver16.flightgear.org (Kansas City, MO) — MP Server Status
Good hunting!
truthsolo
 
Posts: 231
Joined: Sat Feb 12, 2011 2:41 am
Callsign: C-FBAR, Snapper
IRC name: truthsolo
Version: git

Re: Compile a custom version of FGv2 for a change in native_

Postby Johan G » Mon Aug 01, 2011 7:21 pm

:?:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5296
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Compile a custom version of FGv2 for a change in native_

Postby truthsolo » Mon Aug 01, 2011 7:45 pm

I'm going to write up the quick way to build FG on Windows using the pre-compiled libraries Jenkins uses. I am in accelerated college classes though, and must turn in work every Sunday by midnight.. so I was rushing last night to write about 15 pages :roll:

Rasheed PM'd me about compiling and I provided him with the latest git source and some help compiling. He had some errors, but I think they were caused by missing libraries/directory structure. I hope he's got it sorted, but I haven't heard back yet.
Rob — IRC: truthsolo — I run mpserver16.flightgear.org (Kansas City, MO) — MP Server Status
Good hunting!
truthsolo
 
Posts: 231
Joined: Sat Feb 12, 2011 2:41 am
Callsign: C-FBAR, Snapper
IRC name: truthsolo
Version: git

Re: Compile a custom version of FGv2 for a change in native_

Postby Rasheed » Tue Aug 02, 2011 11:40 am

Hey Rob,

Thanks for your help.
Compiling the source was ok.. with no errors and many warnings. However, after running FlightGear I got some errors in the console.
Here are the errors I get after starting flightgear with the option --httpd=5502

Code: Select all
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Httpd server started on port 5502
loading scenario 'nimitz_demo'
creating 3D noise texture... DONE
Could not find at least one of the following objects for animation: 'Mesh61 Model_2'
Could not find at least one of the following objects for animation: 'Mesh61 Model_2'
Could not find at least one of the following objects for animation: 'Mesh61 Model_4'
Could not find at least one of the following objects for animation: 'Mesh61 Model_4'
Could not find at least one of the following objects for animation: 'Mesh66 Model_1'
Could not find at least one of the following objects for animation: 'Mesh66 Model_1'
Could not find at least one of the following objects for animation: 'Mesh67 Model_', 'Mesh68 Model_1'
Could not find at least one of the following objects for animation: 'Mesh67 Model_', 'Mesh68 Model_1'
Could not find at least one of the following objects for animation: 'terminal_2'
Could not find at least one of the following objects for animation: 'terminal_2'
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed
Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed


I copied everything from the Release folder into a separate folder. Also copied all the necessary .dll files from \3rdparty and \install into the same folder. However, I dont think that anything changed. I still get the same errors.
I used Visual Studio 2008 professional to get 32bit binaries.

Rasheed
Rasheed
 
Posts: 3
Joined: Thu Jul 28, 2011 8:29 am

Re: Compile a custom version of FGv2 for a change in native_

Postby truthsolo » Tue Aug 02, 2011 1:29 pm

It may be the port numbers or protocols you're trying to use.. definitely a network issue. Maybe changing the port for httpd, or not using httpd would help? I wouldn't worry about the texture errors until you get rid of the SG_IO_OUT error.
Rob — IRC: truthsolo — I run mpserver16.flightgear.org (Kansas City, MO) — MP Server Status
Good hunting!
truthsolo
 
Posts: 231
Joined: Sat Feb 12, 2011 2:41 am
Callsign: C-FBAR, Snapper
IRC name: truthsolo
Version: git

Re: Compile a custom version of FGv2 for a change in native_

Postby Rasheed » Tue Aug 02, 2011 2:12 pm

I didn't change any thing is the source yet.
I get the errors even if I'm starting without httpd
Rasheed
 
Posts: 3
Joined: Thu Jul 28, 2011 8:29 am

Re: Compile a custom version of FGv2 for a change in native_

Postby truthsolo » Tue Aug 02, 2011 4:25 pm

From the wiki:

Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed

Your computer is not connected with the internet, while a certain enabled feature (eg. multiplayer) does require an internet connection.


So I suspect a problem with A) your network, or B) Windows.. probably B. You could try with multiplayer, terrasync, atlas, and any other network-dependent feature disabled. Also, if you can try the binaries on another machine you can isolate whether it's the network or the computer—as I seriously doubt it's FG in this case. It could even be 3rd-party software interfering with specific network operations; firewall, anti-malware, etc..
Rob — IRC: truthsolo — I run mpserver16.flightgear.org (Kansas City, MO) — MP Server Status
Good hunting!
truthsolo
 
Posts: 231
Joined: Sat Feb 12, 2011 2:41 am
Callsign: C-FBAR, Snapper
IRC name: truthsolo
Version: git

Re: Compile a custom version of FGv2 for a change in native_

Postby Johan G » Fri Aug 05, 2011 7:16 pm

truthsolo wrote in Sun Jul 31, 2011 3:30 pm:I may work on it later this week; Sunday is deadline day.. every week.. for the rest of my life. :(

truthsolo wrote in Mon Aug 01, 2011 7:45 pm:I am in accelerated college classes though, and must turn in work every Sunday by midnight.. so I was rushing last night to write about 15 pages :roll:

Oh. That sounds like quite some workload. :| (Good thing you prioritize school though)
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5296
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest