Board index FlightGear Support Compiling

OpenSceneGraph PATH

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

OpenSceneGraph PATH

Postby TioZe » Wed Jan 15, 2014 7:48 pm

Continuing to show my inexperience...


From the superbuild step through, "Note you will need to add the OpenSceneGraph install directory to the PATH variables in the 'fgfs' target properties".

How is this done? I'm more experienced compiling in a Linux environment so this MSVC stuff is a bit foreign to me.

Thanks.
TioZe
 
Posts: 6
Joined: Fri Jan 10, 2014 12:56 pm

Re: OpenSceneGraph PATH

Postby rreiter » Thu Jan 16, 2014 5:22 am

Hi, I'm also a newbie when it comes to building flightgear but I'll try and answer the way I did it and maybe someone else can tell us it's right or wrong.
I've been having failures trying to run Flightgear in debug mode (debug assertion failure - "vector iterator not incrementable") and it may have to do with these settings we are talking about here.
Here is where I set the PATH, let me know if it works for you:

In Solution Explorer window, right-click on fgfs node and select Properties menu item to open the "fgfs Property pages" window.
Expand the Configuration Properties and under it select Debugging .
You should see a row labelled Environment.
Click on that row and then on the right-side the downarrow and select <Edit...> and there you can enter the path setting, eg, here is mine:
PATH=V:/homevs/metabuild/install/msvc100/OpenSceneGraph/bin

(During my own testing I've also added a path to my build's FG_ROOT since I'm still fumbling a bit about what's needed where.)
FG_ROOT=V:/homevs/metabuild/fgbuild/src/Main

Note that on the same window where you set Environment, you can also set Command Arguments for the app itself.
I've set mine something like this: "--fg-root=V:\homevs\metabuild\fgbuild\src\Main\data
--fg-scenery=V:\homevs\metabuild\fgbuild\src\Main\data\Scenery;V:\homevs\metabuild\fgbuild\src\Main\terrasync --terrasync-dir=V:\homevs\metabuild\fgbuild\src\Main\terrasync --airport=KSFO --aircraft=777-200 --control=joystick --disable-random-objects --prop:/sim/rendering/random-vegetation=false --disable-hud-3d --enable-ai-models --disable-ai-traffic --disable-real-weather-fetch --prop:/sim/menubar/autovisibility/enabled=1 --geometry=1024x768 --bpp=32 --prop:/sim/rendering/multi-sample-buffers=1 --prop:/sim/rendering/multi-samples=4 --timeofday=morning --enable-terrasync --disable-fgcom --prop:/sim/rendering/rembrandt/enabled=false"

As I'm still having issues myself, I hope my explanation does more to help than hurt and invite anyone else to chime in.
rreiter
 
Posts: 35
Joined: Thu Jan 16, 2014 4:33 am
Location: Newmarket, Ontario Canada
OS: Windows

Re: OpenSceneGraph PATH

Postby TioZe » Thu Jan 16, 2014 1:28 pm

Ok, thanks for the suggestions. I'll try them out to see if they help.

Also, hopefully this isn't too silly of a question, but how to I run it after it builds successfully? Just finding the executable and running it seems to throw errors related to this OpenSceneGraph stuff. I have an older version of the software installed which I didn't compile and it is laid out on the disk much differently than my home build is. Do I need to do anything else before I can run it for testing?

Thanks.
TioZe
 
Posts: 6
Joined: Fri Jan 10, 2014 12:56 pm

Re: OpenSceneGraph PATH

Postby rreiter » Fri Jan 17, 2014 4:08 am

To try and run in debug mode (Flightgear.sln)
In the main MSVC menu, select Build | Configuration Manager. It opens a window that should show your "Active Solution Configuration" set to "Debug".
Check to make sure fgfs project node in Solution Explorer window is set as the "Startup Project" (ie, right-click, select Set as Startup Project just as described in the wiki).
Next, to actually run, again right-click fgfs project node, select Debug | Start New Instance. Or you can try F5 or look for a green right-arrow "Play" button on the toolbars. It may or may not rebuild before actually starting.

Regarding project folder structure.
The the following description is based on how mine ended up looking, so take it with a grain of salt - I'm a newbie myself.

First, I followed the wiki for a 32-bit build, which is what I'm working on. I'm not yet sure how different 64bit is.
What you need to know is that project binaries that MSVC compiles while in Debug configuration typically end up in a [Debug] folder and when in Release configuration they go into a [Release] folder. You can determine what these locations are by using a project node's right-click context menu - select Properties -> Configuration Properties -> General -> Output Directory.

In my case the Debug folder ended up in this path when I followed the wiki:
\metabuild\fgbuild\src\Main\Debug

The structure of what's in [Debug] looks a lot like what you get when you download a "daily build v2.99" (which I gotten earlier before I decided to try and build it myself).
But if you look in [Debug], you'll see that it is missing a lot of binaries you'd expect to see in a deployment, which is why for example you provide the PATH setting to where the OpenSceneGraph files can be found.

For all of the following, I'm not sure any of it was necessary, but here's what I did after not being able to launch fgfs.exe in Debug mode within [Debug] folder.

I populated [debug] with a full fileset and make its parent [Main] folder more like a real deployment.
I suppose I could have just added a ton of PATHS or played with other settings, but this seemed easier:
*Under [Main]:
I added a complete copy of [data] (downloaded from gitorious / next for my "daily build").
I also added empty [scenery] and [terrasync] folders.

*To populate [Debug] I made a windows batch (bat) file that copies the missing binaries from the various other projects using the commands below.
In the first 5 lines, [V:\Flightgear\bin] refers to my "daily build" I had previously installed., the rest are all within my superbuild paths.

xcopy V:\Flightgear\bin\FedTime.dll V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\Flightgear\bin\OpenRTI.dll V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy "V:\Flightgear\bin\RTI-NG.dll" V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\Flightgear\bin\PocoFoundation.dll V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\Flightgear\bin\PocoNet.dll V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
rem
xcopy V:\homevs\metabuild\install\msvc100\OpenSceneGraph\bin\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\3rdParty\bin\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgrunbuild\src\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\install\msvc100\FlightGear\bin\fgjs.exe V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\install\msvc100\FlightGear\bin\js_demo.exe V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\install\msvc100\FlightGear\bin\yasim.exe V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy "V:\homevs\metabuild\install\msvc100\FlightGear\bin\yasim-proptest.exe" V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\install\msvc100\FlightGear\bin\fgcom.exe V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\fgadmin\src\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\fgcom\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\fgelev\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\fgpanel\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\GPSsmooth\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\TerraSync\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R
xcopy V:\homevs\metabuild\fgbuild\utils\fgviewer\Debug\*.* V:\homevs\metabuild\fgbuild\src\Main\Debug\*.* /V /E /Y /F /R

*Finally I also made sure to backup and then edit the following files (if present) and correct all the file paths present inside
my C:\Users\...\AppData\Roaming\[flighgear.org] folder:
autosave_2_99.xml
fgrun.prefs

and also: \metabuild\fgbuild\src\Main\Debug\settings.txt

*During debug run I encountered a version mismatch error at the point when it checks for what code/data is installed.
I think I had to make sure the [data] "version" file was present and matched the "version" string in fgrun.prefs file.

I probably didn't need to do a lot of the above, but at least right now it will start running in Debug mode (it still fails but not until I use the mouse once I'm in the cockpit).
Once I get it working better I can slowly figure out which of the above I really didn't need to do, unless some else tells us here first.

Let me know how it goes, particularly if you do something that's not in the wiki that gets it to work.
rreiter
 
Posts: 35
Joined: Thu Jan 16, 2014 4:33 am
Location: Newmarket, Ontario Canada
OS: Windows


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests