Page 1 of 2

Unable to run freeorion (Solved again)

Posted: Wed Feb 18, 2009 2:46 am
by Infiltrator
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.

Re: Unable to run freeorion (Solved again)

Posted: Thu Mar 19, 2009 10:27 am
by Sandstein
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

Re: Unable to run freeorion (Solved again)

Posted: Thu Mar 19, 2009 12:38 pm
by Geoff the Medio
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.

Re: Unable to run freeorion (Solved again)

Posted: Thu May 28, 2009 10:34 pm
by cazfi
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)

Re: Unable to run freeorion (Solved again)

Posted: Thu May 28, 2009 11:26 pm
by OndrejR
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.

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 12:07 am
by Geoff the Medio
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...

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 8:41 am
by kroddn
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!

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 11:28 am
by cazfi
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.

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 11:38 am
by cazfi
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

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 12:08 pm
by cazfi
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

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 2:32 pm
by kroddn
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).

Re: Unable to run freeorion (Solved again)

Posted: Fri May 29, 2009 3:20 pm
by Geoff the Medio
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

Re: Unable to run freeorion (Solved again)

Posted: Sun May 31, 2009 7:30 pm
by cazfi
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")

Re: Unable to run freeorion (Solved again)

Posted: Sun May 31, 2009 11:09 pm
by Geoff the Medio
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.

Re: Unable to run freeorion (Solved again)

Posted: Tue Jun 02, 2009 8:36 pm
by cazfi
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.