#518 error: ‘initfreeOrionLogger’ was not declared in this scope


64-bit Arch Linux
freeorion revision 5096
gcc 4.7.1
boost 1.50.0

When trying to compile, I get this error:

Scanning dependencies of target freeorionca
[ 63%] Building CXX object client/AI/CMakeFiles/freeorionca.dir/__/__/AI/AIInterface.cpp.o
[ 63%] Building CXX object client/AI/CMakeFiles/freeorionca.dir/__/__/AI/PythonAI.cpp.o
/home/alexander/archpackages/community/freeorion/trunk/src/freeorion-build/AI/PythonAI.cpp: In constructor ‘PythonAI::PythonAI()’:
/home/alexander/archpackages/community/freeorion/trunk/src/freeorion-build/AI/PythonAI.cpp:207:29: error: ‘initfreeOrionLogger’ was not declared in this scope
/home/alexander/archpackages/community/freeorion/trunk/src/freeorion-build/AI/PythonAI.cpp:208:34: error: ‘initfreeOrionAIInterface’ was not declared in this scope
make[2]: *** [client/AI/CMakeFiles/freeorionca.dir/__/__/AI/PythonAI.cpp.o] Error 1
make[1]: *** [client/AI/CMakeFiles/freeorionca.dir/all] Error 2
make: *** [all] Error 2


  • Anonymous - 2012-09-09

    Doublechecked, and I could only find the string "initfreeOrionLogger" in AI/PythonAI.cpp

  • Geoff Topping

    Geoff Topping - 2012-09-09

    initfreeOrionLogger is created by the boost::python macro in PythonAI.cpp, BOOST_PYTHON_MODULE(freeOrionLogger)

    This has been reported on the forums


    and seems to be related to building against the wrong version of Python. It should be 2.7.x.

  • Anonymous - 2012-09-09

    I am setting PYTHON_INCLUDE_DIR:PATH in CMakeCache.txt to /usr/include/python2.7 and PYTHON_LIBRARY:FILEPATH to /usr/lib/libpython2.7.so. So, python 2.7 is installed (and both the directory and file does exists).

    Is changing these values in CMakeCache.txt the wrong approach?


  • Geoff Topping

    Geoff Topping - 2012-09-09

    I don't know what you need to do to get it to build against a different version of Python than it defaults to, even assuming that's actually the issue. Weird issues like this with CMake is half the reason I don't use it to build on Windows.

    Maybe try checking what PY_MAJOR_VERSION is set to in your build... That might indicate if the expected Python version is being used.

    There's also a patch posted here, which might help: http://www.freeorion.org/forum/viewtopic.php?p=53631#p53631

  • Anonymous - 2012-09-09

    I think I found a way to force cmake to use python "2.7" instead of "3.2mu" (both are installed, python 3 is default on Arch Linux). It's compiling right now. Thanks for the pointers.

  • Geoff Topping

    Geoff Topping - 2012-09-09

    If it works, please describe the process, as I expect someone else will have similar problems in future.

  • Anonymous - 2012-09-10


    Several tricks were applied to:
    - Find the correct revision that corresponds to the desired version umber
    - Patch cmake to give a message if the wrong version of Python is configured (3 instead of 2)
    - Actually configure cmake to use Python 2.7 instead of 3
    - Tweak the C++ flags in CMakeCache.txt, so that the compilation doesn't use too much memory
    (I have 4GB of memory in the computer I'm sitting at right now, which was no match for the compilation process).
    "-fno-var-tracking" was used for this purpose.
    - Fix the boost TIME_UTC problem
    - Only compile with one thread (make -j1) to help use less memory
    - Configure ogre_plugins.cfg to look in the right place

    An lo and behold, now it actually compiles! I'll compile the official packages for both 64-bit (x86_64) and 32-bit (i686) now and check that it runs too.

    Here's the PKGBUILD textfile that contains all the tweaks and tricks:

    Here's the cmake patch for detecting which python version is configured (from the forums):
    Thanks to "Space Krill" for the patch: http://www.freeorion.org/forum/viewtopic.php?p=53631#p53631

    Attaching the PKGBUILD and patch as well.

    Thanks for the pointers and guidance.

  • Anonymous - 2012-09-10
  • Anonymous - 2012-09-10
  • Geoff Topping

    Geoff Topping - 2012-09-10

    "Space Krill" is the forum rank. The username for that post is hasufell.

  • Geoff Topping

    Geoff Topping - 2012-09-10
    • status: open --> closed
  • Geoff Topping

    Geoff Topping - 2012-09-10

    In the PKGBUILD thing you linked, you appear to have unnecessary dependencies:
    nvidia cg toolkit
    gigi twice (needed, but why twice? also, does the -12 refer to the version in the FO repository?)

    There's also no dependency on OIS (which is also in the FreeOrion repository, though a less functional build will work with their release versions...), zlib, or freetype2 (which gigi needs), or libpng.

    There are also some dependencies I don't recognize, which ma or may not be necessary, such as "gendesk", and two copies of "desktop-file-utils".

    Also, how portable to other Linux users are the -j1 and -fno-var-tracking flags you mentioned? I'm wondering if they're something that can / should be added to the Compile in Linux wiki page?

  • Anonymous - 2012-09-10


    I'll look into the nvidia cg toolkit, sdl and graphviz dependencies.
    subversion is needed in order to check out the code from subversion (only done when I create the package, not normally when users install freeorion with "pacman -S freeorion").

    We have a package checking tool called namcap that doesn't report any errors, in the dependencies or otherwise, for this particular PKGBUILD.

    You are completely right that gigi doesn't need to be included twice, I'll remove it for the next release, but it doesn't do any harm either. Gigi 0.8.0-12 refers to gigi 0.8.0, the 12th release of our Arch Linux package for this package version (which is Gigi from the freeorion repository).

    The other dependencies (possibly except OIS, I'll look into that at a later time), like zlib and freetype, are implicitly included through thte other dependencies and not forgotten.

    gendesk is a utility that can create the desktop shortcut (.desktop file), since that is lacking from freeorion. If you want, I can attached the generated .desktop file here, so that it may be included in future releases.

    desktop-file-utils is a package from freedesktop that includes tools for updating application shortcuts, amongst others.

    The "make -j1" to specify that make should only use one thread should be portable and unproblematic to use for any system. "-fno-var-tracking" is probably gcc-specific and I'm not sure if it's supported everywhere and for old versions of gcc or not. It's probably okay.

    The official Arch Linux packages for freeorion has been updated now, so that all Arch Linux users can now type just "pacman -S freeorion" in order to install freeorion without having to compile it themselves. This installation command could maybe be mentioned on the freeorion webpage?

    Best regards,
    Alexander Rødseth


Log in to post a comment.