Technical support > Linux

Can't compile source with Arch Linux

(1/3) > >>

cmmps:
Hi there!
I was trying to update ufoai 2.6-dev and now I can't compile it anymore. I tried to delete the folder, clone it again from git but the problem remains.

This is what I get from ./configure (maybe there's a clue here but I'm not sure):

--- Code: ---use c compiler: cc
use c++ compiler: c++
Debug build
Compile for linux
Compile for x86_64
Disable ccache
Using default CFLAGS
Using default LDFLAGS
Found cc cc
Found cxx c++
Using bindir /usr/local/bin/
Using datadir /usr/local/games/ufo/
Using libdir /usr/local/lib/
Using prefix /usr/local
Enable hard linked cgame
Use signal handler
Setting custom data directory
Setting custom library directory
Found zip from zip
Found python from python
Found doxygen from doxygen
Found xvid.h
Found theora/theora.h
Found execinfo.h
Could not find bfd.h
Found sys/utsname.h
Found link.h
Found jpeglib.h
Found zlib.h
Found png.h
Found curl/curl.h
Found lua.h
Could not find mxml.h
Found SDL.h
Found SDL_mixer.h
Found SDL_ttf.h
Found SDL.h
Found SDL_mixer.h
Found SDL_ttf.h
Could not find picomodel.h
Found gtk/gtk.h
Could not find gtksourceview/gtksourceview.h
Found libxml/parser.h
Found AL/al.h
Found gtk/gtkglwidget.h
Build modules:
Build cgame-campaign
Build cgame-multiplayer
Build cgame-skirmish
Build game
Build memory
Build testall
Build ufo2map
Build ufoded
Build ufo
Build ufomodel
Disable uforadiant
Build ufoslicer

--- End code ---

And the error (lua related, I believe):

--- Code: ---===> LD [base/game.so]
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `actorL_shoot(lua_State*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:534: undefined reference to `lua_tonumberx'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `actorL_throwgrenade(lua_State*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:598: undefined reference to `lua_tonumberx'
/mnt/games/ufoai/src/game/g_ai_lua.cpp:609: undefined reference to `lua_tonumberx'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `AIL_positionshoot(lua_State*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:1323: undefined reference to `lua_tonumberx'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `AIL_positionhide(lua_State*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:1461: undefined reference to `lua_tonumberx'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o:/mnt/games/ufoai/src/game/g_ai_lua.cpp:1502: more undefined references to `lua_tonulow
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `AIL_ActorThink(Player&, Actor*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2114: undefined reference to `lua_getglobal'
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2117: undefined reference to `lua_pcallk'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `AIL_TeamThink(Player&)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2163: undefined reference to `lua_getglobal'
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2166: undefined reference to `lua_pcallk'
debug-linux-x86_64/game/game/g_ai_lua.cpp.o: In function `AIL_InitActor(Actor*)':
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2221: undefined reference to `lua_getglobal'
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2231: undefined reference to `lua_pcallk'
/mnt/games/ufoai/src/game/g_ai_lua.cpp:2237: undefined reference to `lua_setglobal'
collect2: error: ld returned 1 exit status
make: *** [Makefile:173: base/game.so] Error 1

--- End code ---

I'm running an updated system with Arch Linux x86_64 on an AMD FX6000 (6 core) CPU.

Any ideas?

Thanks,
Carlos Santos

Norby:
Hi!

Try to eliminate the "Could not find" lines from configure by installing the packages which contain the missing .h files. This helped me in Debian, I seached in packages.debian.org after all files, the only what I could not find is picomodel.h but since I fixed all others the game compile witthout errors.

cmmps:
Thank you Norby

I believe the problem is more "lua related". However I checked the "could not find" files and installed the packages "mxml" and "gtksourceview2" that were missing. For "bfd.h", the strangest thing is that it belongs to the "binutils" package which is installed already. For "picomodel.h", I believe it's a project hosted on github and it's essentially for "uforadiant".

Now the "Could not find" lines appear for "bfd.h" and "picomodel.h".

It still crashes with the same errors :(

Namerutan:
Hola Carlos:

I'm not an expert in this area, but I guess the problem with lua could be related to not finding the binutils lib, so I would double check it.
Just in case it helps, in source code bfd.h is located under /src/shared/bfd.h

but I think it should be enough to install the lib the usual way:
sudo apt-get install binutils-dev

Suerte!

cmmps:
Thank you Namerutan but this is Arch Linux. The header files here are under /usr/include and bfd.h is there, what makes it more weird.
And this files comes with the package "binutils" so, when you install it with:

--- Code: ---sudo pacman -S binutils
--- End code ---
/usr/include/bfd.h will be created.

However, I believe that this is not the problem as the cpp files are compiled and the error is with lua when the build performs a "LD" on "game.so". It seems it is not looking for lua in the right place.

With some more further search I found the very same problem reported on Arch Linux forums:
https://bbs.archlinux.org/viewtopic.php?id=208203

And it seems there is a patch uploaded into UFO AI Issue tracker here:
http://ufoai.org/bugs/ufoalieninvasion/issues/5632

However, it does not work. Indeed, I have lua5.3 and the lua.h file is directly below /usr/include but for lua5.1 it can be found under /usr/include/lua5.1
So I manually changed the configure file according to the following patch:

--- Code: ---diff --git a/configure b/configure
index c1f9379..2ca8e02 100755
--- a/configure
+++ b/configure
@@ -238,7 +238,7 @@ check_headers() {
        check_header "zlib.h" "zlib"
        check_header "png.h" "libpng"
        check_header_bundled "curl/curl.h" "libcurl"
-       check_header_bundled "lua.h" "lua5.1"
+       check_header_bundled "lua5.1/lua.h" "lua5.1"
        check_header_bundled "mxml.h" "mxml"
        check_header "SDL.h" "sdl"
        check_header "SDL_mixer.h" "SDL_mixer"

--- End code ---

I also tried:

--- Code: ---./configure --with-embedded-lua5.1
--- End code ---
But it also failed to build.

I'm getting out of ideas... :(

I'm going to place this problem in the Arch forum as well.

Navigation

[0] Message Index

[#] Next page

Go to full version