[solved] Problems with include and resource paths

Questions, problems and discussion about compiling FreeOrion.
Post Reply
Message
Author
iron_gollum
Krill Swarm
Posts: 14
Joined: Fri Aug 20, 2010 8:04 pm

[solved] Problems with include and resource paths

#1 Post by iron_gollum » Mon Aug 23, 2010 4:26 pm

This is a solved problem, I post it for the case more newbies get in trouble with the same issue.

I had problems with compiling FreeOrion after I downloaded the SDK. The compiler pretended not to find the file <alut.h>. After I updated the project via SVN, it worked again.

Another problem was that upon running, the game exited, telling it was unable to find the file RenderSystem_GL.dll. The program tried to search for it in "Program Files", an attemt that failed. Apparently, the reason was that I had a precompiled version of FreeOrion previously installed into "Program files", and config.xml listed wrong paths. Removing this file helped.

Below is attached my correspondence with Geoff the Medio, to whom I thank a lot for help.
iron_gollum wrote:P.S. I had to add '../../../../include/AL' to the additional include directories list, otherwise the soluton wouldn't compile.
Geoff the Medio wrote:To which project? The freeorion project, which is the only one that uses any sound stuff, already has that include directory specified.
iron_gollum wrote:this is strange, for I can't compile the freeorion project without changing project properies. And even after compilation, I can't run the program, it states that it cannot find RenderSystemGl.dll, although the .dll file is also there. Maybe there is a problem with the reading of .xml file? Can you tell me, at which point the project accesses it?
Geoff the Medio wrote:
iron_gollum wrote:this is strange, for I can't compile the freeorion project without changing project properies.
But what did you change? The project already has that include directory specified... so where do you add it?
And even after compilation, I can't run the program, it states that it cannot find RenderSystemGl.dll, although the .dll file is also there. Maybe there is a problem with the reading of .xml file? Can you tell me, at which point the project accesses it?
How are you trying to run it? From the MSVS run button? In that case, you probably need to tell it the target path and working directory, which aren't stored in the project files you downloaded. These are in the project properties, configuration properties, debugging section. I set Command to $(TargetPath) and Working Directory to $(TargetDir).

But I still don't have much luck running with the debugger attached for unknown reasons, and generally just run from the command line. To do that, make sure the target path is in the main freeorion directory where all the DLLs that came with the SDK are located, and then run "freeorion" or "freeorion -q" (for quickstart) from the msvs command prompt (cmd.exe) starting from the proper directory.
iron_gollum wrote:
But what did you change? The project already has that include directory specified... so where do you add it?
The original project has only these additional include directories:

../../../log4cpp/
../../../../include/
../../../../Boost/include/boost_1_42
../../../GG/
../../include
../../../../include/OGRE
../../../../include/bullet


And alut.h states:
#if defined(_MSC_VER)
#include <alc.h>
#include <al.h>
#elif defined(__APPLE__)
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
which apparently means that for Windows, the path to these both files is not correctly specified (yes, I am a Windows user :oops: ). So if I add ../../../../include/AL to Properties->C/C++->General->Additional include directories, it compiles perfectly.
How are you trying to run it? From the MSVS run button?
Yes, I tried this one. But now the program tries to access files from the directory Program Files/FreeOrion/default. Is threre a way to make it operate in the directory where the .exe file compiles to?
Geoff the Medio wrote:
iron_gollum wrote:The original project has only these additional include directories:
As I said before, the freeorion project in SVN already has that include directory specified (see line 45). You must not be using that project file. Have you updated to the latest SVN, and are you using the MSVS project file from SVN, or one generated with CMake?
iron_gollum wrote:But now the program tries to access files from the directory Program Files/FreeOrion/default. Is threre a way to make it operate in the directory where the .exe file compiles to?
Delete your config.xml or edit it to point <resource-dir> to the desired default directory (presumably within the SDK directory).

Post Reply