Unable to run freeorion (Solved again)

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report. For problems building from source, post in Compile.
Message
Author
Infiltrator
Space Krill
Posts: 4
Joined: Wed Feb 18, 2009 2:41 am

Unable to run freeorion (Solved again)

#1 Post by Infiltrator » Wed Feb 18, 2009 2:46 am

Okay, well, it took me a while to compile it, but I finally got it to. Though, no doubt I did something wrong.
Whenever I try to run freeorion, the window pops up, stays black, but then quits, and I get the following errors.

Code: Select all

main() caught exception(std::exception): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library libGiGiOgrePlugin_OIS.so.  System Error: /usr/local/lib/libGiGiOgrePlugin_OIS.so: undefined symbol: _ZTIN3OIS8KeyboardE in DynLib::load at OgreDynLib.cpp (line 80)
AL lib: ALc.c:1302: exit() 1 device(s) and 1 context(s) NOT deleted
AL lib: alSource.c:2291: alcDestroyContext(): 16 Source(s) NOT deleted
AL lib: alBuffer.c:1097: exit() 2 Buffer(s) NOT deleted
Help? :P

Oh, um, running Debian Lenny (well, unstable) on an amd64 platform. Not sure what other info to give.

Nevermind. Redownloaded and recompiled from the SVN and it starts now. Now to play for the first time. :P


Nevermind again. I ran it once. Then I exited, now it refuses to run again...
Says this:

Code: Select all

main() caught exception(std::runtime_error): Failed to find an Ogre GL render system.
Okay, well, recompiling it once again seems to have fixed it for now. I'll quit and see if it will start again.
Yup, working.


By the way, if anybody else is having the same problem, it's most likely because you've upgraded the ogre3d library, and freeorion is statically linked to the wrong place now.

Sandstein
Space Krill
Posts: 1
Joined: Wed Mar 18, 2009 3:50 pm

Re: Unable to run freeorion (Solved again)

#2 Post by Sandstein » Thu Mar 19, 2009 10:27 am

Hi,

i have the same problem here..... starts and black screen

Code: Select all

main() caught exception(std::runtime_error): Failed to find an Ogre GL render system
I have installed OGRE 1.6.1 SDK for Visual C++ .Net 2008 (9.0)

I recompile FO but nothing happens.
So i try to copy the freeorion.exe from my MSVC developer folder in the installation folder (c:\programme\freeorion\) version 0.3.12 rev2806.
Ok....i get the error he doesnt find the correct boost files (boost_thread-vc90-mt-1_38.dll ...... ) so i copy it from my developer folders into the installation folder of FO and it works.

So my question... how can i start FO directly from my developer folder without copying the .exe file? All libs that i need are in the same folder but it doesn't work.

After 2 days of compiling all the differnt libs and codes from the tools and plugins i'm happy when i can see the starting screen.

Maybe you can help

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Unable to run freeorion (Solved again)

#3 Post by Geoff the Medio » Thu Mar 19, 2009 12:38 pm

I don't know why a compiled SVN version would run in the v0.3.12 installed folder but not in the build directory, but you might try deleting config.xml, and copying all the DLLs from the install folder to the dev folder. There are at least two DLLs missing in the SDK (cg.dll and Plugin_CgProgramManager.dll) but I think they'd be mentioned specifically as missing (from the dev folder) if that was your problem.

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#4 Post by cazfi » Thu May 28, 2009 10:34 pm

I also encountered this same error

Code: Select all

main() caught exception(std::runtime_error): Failed to find an Ogre GL render system.
I looked from the source code where it printed error message like that and debugged error to missing ogre_plugins.cfg file. This problem was solved when I copied ogre_plugins.cfg from source tree to my datadir (default would be /usr/local/share/freeorion)

At the same time I wonder why bindir and datadir defaults are not relative to prefix (according to "scons -h")? Now I have to set all three separately to install freeorion to separate directory hierarchy.

It still refused to start with

Code: Select all

main() caught exception(std::exception): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library ./RenderSystem_GL.  System Error: ./RenderSystem_GL.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 81)
As error message points out that plugin library is looked from current directory, I changed my working directory to ogres plugin directory (cd <ogreprefix>/lib/OGRE) and run freeorion from there. It started to start menu!

(...but segfaulted when I tried to begin playing)

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Unable to run freeorion (Solved again)

#5 Post by OndrejR » Thu May 28, 2009 11:26 pm

Did you change file ogre_plugins.cfg content to:

Code: Select all

PluginFolder=/usr/local/lib/OGRE
?

Another problem may be if you have ATI.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Unable to run freeorion (Solved again)

#6 Post by Geoff the Medio » Fri May 29, 2009 12:07 am

cazfi wrote:I looked from the source code where it printed error message like that and debugged error to missing ogre_plugins.cfg file. This problem was solved when I copied ogre_plugins.cfg from source tree to my datadir (default would be /usr/local/share/freeorion)

At the same time I wonder why bindir and datadir defaults are not relative to prefix (according to "scons -h")? Now I have to set all three separately to install freeorion to separate directory hierarchy.
The datadir and bindir *defaults* are necessarily determined in C++ code, and have to function even if there are no files available to provide them. The only way (I think?) to have these defaults change depending on the scons parameters would be to have the scons script modify the source code before compiling. This isn't very portable to other build systems.

There should be a way to get the actual binary directory, though, rather than using the current scheme of 1) trying the hard coded location and if that fails 2) hope it's the same as the working directory. Having this, all the ogre cfg files can be put there and should be reliably gettable.

Edit: There probably is, if my attached patch from a few years ago works as it's supposed to... /Edit

I don't think there's any sensible way to get the data dir, if it's not in the default location, though. We should probably add a command-line switch to specify this directory. Currently the workaround is, I think, to generate config.xml with "freeorion -g" and then edit that file to specify the data directory.
(...but segfaulted when I tried to begin playing)
There are a vareity of possible causes of this. To start, as OndrejR noted, do you have an ATI graphics card and does your card support OpenGL 2.0? If yes, once you get to the main menu and before starting the game, can you go into the options menu - from the main menu button - and go to the galaxy map tab, and disable galaxy gas rendering, starfields rendering, fog of war scanlines, and optimized system rendering, and then try starting a game? If this works, try enabling those options one at a time, to see if it will run with them enabled.

I'm slightly concerned that you'll have trouble launching the server or AIs, though given that their binaries will be in nonstandard locations that apparently the program has trouble dealing with...
Attachments
binary_location.zip
out of date but illustrative patch for how to get binary directory from argv[0] and boost::fs::system_complete (hopefully)
(1.72 KiB) Downloaded 119 times

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Unable to run freeorion (Solved again)

#7 Post by kroddn » Fri May 29, 2009 8:41 am

You can edit the ogre_plugins.cfg to point to your <ogreprefix>/lib/OGRE dir, or you can make symlinks to your FreeOrion dir:

Code: Select all

cd FreeOrion
ln -s /usr/local/lib/OGRE/Plugin_CgProgramManager.so  .
ln -s /usr/local/lib/OGRE/Plugin_OctreeSceneManager.so  .
ln -s /usr/local/lib/OGRE/RenderSystem_GL.so  .
ln -s /usr/local/lib/OGRE/Plugin_ParticleFX.so  .
If you change the working directory out of FreeOrion, you will NOT be able to run the game, because it will try to find ./freeoriond and ./freeorionca as soon as you start a game.

Also, please make sure you installed nvidia Cg on your system and you compiled OGRE with Cg support!

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#8 Post by cazfi » Fri May 29, 2009 11:28 am

OndrejR wrote:Did you change file ogre_plugins.cfg content to:

Code: Select all

PluginFolder=/usr/local/lib/OGRE
Thanks, that (or rather; correct value) fixed the workdir problem
OndrejR wrote:Another problem may be if you have ATI.
Yeah, I'll try another machine with nvidia.

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#9 Post by cazfi » Fri May 29, 2009 11:38 am

kroddn wrote:If you change the working directory out of FreeOrion, you will NOT be able to run the game, because it will try to find ./freeoriond and ./freeorionca as soon as you start a game.
Actually those processes are launched ok according to process list just before the crash.

This is what I did (dependencies are built under /home/cazfi/freeorion/sys):

Code: Select all

cd /home/cazfi/freeorion/TRUNK/FreeOrion
PKG_CONFIG_PATH=/home/cazfi/freeorion/sys/lib/pkgconfig scons configure ... prefix=/home/cazfi/freeorion/install bindir=/home/cazfi/freeorion/install/bin datadir=/home/cazfi/freeorion/install/share/freeorion ...
scons install
cd ../..
LD_LIBRARY_PATH=/home/cazfi/freeorion/sys/lib install/bin/freeorion

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#10 Post by cazfi » Fri May 29, 2009 12:08 pm

Geoff the Medio wrote:The datadir and bindir *defaults* are necessarily determined in C++ code, and have to function even if there are no files available to provide them. The only way (I think?) to have these defaults change depending on the scons parameters would be to have the scons script modify the source code before compiling. This isn't very portable to other build systems.
Hmm... well, okay, we may have several levels of *default* here. I were talking about scons parameter defaults.

Code: Select all

prefix
    Location to install FreeOrion
    value=/usr/local
    default=/usr/local

    ...

bindir
    Location to install executables
    value=/usr/local/bin
    default=/usr/local/bin

datadir
    Location to install application data
    value=/usr/local/share/freeorion
    default=/usr/local/share/freeorion
Compare to e.g. GG:

Code: Select all

prefix
    Location to install GG
    value=/usr/local
    default=/usr/local

    ...

incdir
    Location to install headers
    value=/usr/local/include
    default=$prefix/include

bindir
    Location to install executables
    value=/usr/local/bin
    default=$prefix/bin

libdir
    Location to install libraries
    value=/usr/local/lib
    default=$prefix/lib

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Unable to run freeorion (Solved again)

#11 Post by kroddn » Fri May 29, 2009 2:32 pm

As long as your freeorion binary loads and crashes with such a segfault, your build is okay. I do such pkgconfig stuff similar to the way you do.

Before any more steps, please try with an nvidia card! The game should at least pop up a black windows and then crash - if that happens, the problem may be missing open GL support (or ATI card problem).

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Unable to run freeorion (Solved again)

#12 Post by Geoff the Medio » Fri May 29, 2009 3:20 pm

cazfi wrote:
OndrejR wrote:Another problem may be if you have ATI.
Yeah, I'll try another machine with nvidia.
Another thing to try, which I'd like to hear back about, is to find the function OgreGUI::Enter2DMode in GG/src/Ogre/OgreGUI.cpp and replace

Code: Select all

    if (glUseProgramARB)
        glUseProgramARB(0);
with

Code: Select all

    glUseProgram(0);
This seems to be (one of the?) issue with ATI cards, and is discussed here as well: viewtopic.php?p=36944#p36944

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#13 Post by cazfi » Sun May 31, 2009 7:30 pm

Geoff the Medio wrote:Another thing to try, which I'd like to hear back about, is to find the function OgreGUI::Enter2DMode in GG/src/Ogre/OgreGUI.cpp and replace

Code: Select all

    if (glUseProgramARB)
        glUseProgramARB(0);
with

Code: Select all

    glUseProgram(0);
This seems to be (one of the?) issue with ATI cards, and is discussed here as well: viewtopic.php?p=36944#p36944
Guy in that other thread mentions that his crash occured at glUseProgramARB(). Mine does not, but RenderXxx() (where Xxx depends on what options I have enabled)

Anyway, attempt to call glUseProgram(0); resulted in compiler error "error: 'glUseProgram' was not declared in this scope"

I have now compiled FreeOrion on machine with nvidia and it works a bit better there. It goes to game screen, but halts after a couple of seconds. That particular machine has been rather unstable later, so this is probably not FreeOrion's fault. In any case, I'm quite confident that my build process works. Do you want me to submit "user story" to wiki about how to build and install FreeOrion and dependencies to directory tree of their own? (so that you don't need root access, and can be sure that everything FreeOrion related is removed from your system by simply "rm -Rf freeorion")

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Unable to run freeorion (Solved again)

#14 Post by Geoff the Medio » Sun May 31, 2009 11:09 pm

cazfi wrote:I have now compiled FreeOrion on machine with nvidia and it works a bit better there. It goes to game screen, but halts after a couple of seconds.
Is there anything interesting in the log files? (or just post them after a crash or "halt")
Do you want me to submit "user story" to wiki about how to build and install FreeOrion and dependencies to directory tree of their own? (so that you don't need root access, and can be sure that everything FreeOrion related is removed from your system by simply "rm -Rf freeorion")
Sure; more user stories are aways helpful and appreciated.

cazfi
Space Floater
Posts: 42
Joined: Thu May 28, 2009 10:08 pm

Re: Unable to run freeorion (Solved again)

#15 Post by cazfi » Tue Jun 02, 2009 8:36 pm

cazfi wrote:At the same time I wonder why bindir and datadir defaults are not relative to prefix (according to "scons -h")? Now I have to set all three separately to install freeorion to separate directory hierarchy.
Further testing proved that they actually are correctly relative to prefix, 'scons -h' just doesn't make that clear (it shows paths relative to currently configured prefix, doesn't tell that changing prefix would change those paths) I tried to write a patch that makes their handling similar to what GG uses, but that didn't work. My scons experience is very limited.

Post Reply