Page 1 of 1

[SOLVED] Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 12:34 am
by gomez
Hey everyone,
I tried to compile the LÖVE-Android, following in the steps of the tutorial proposed in the repository (this one: https://bitbucket.org/MartinFelis/love- ... id_-_Linux) and i've got error in the compilation process.
I pasted the error here: http://pastebin.com/Qfd0V8j6
How do i solve this error ?

Re: Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 5:08 am
by airstruck
I think you need C++11, try updating gcc/g++

Re: Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 1:37 pm
by gomez
time thief wrote:I think you need C++11, try updating gcc/g++
I'm using GCC 4.9..
I changed a variable in Application.mk file and then it went further. But I still can't compile T-T
New error: http://pastebin.com/ZBp39Lq3

:cry: :cry: :cry: :cry: :cry:

Re: Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 2:12 pm
by bartbes
gomez wrote: I'm using GCC 4.9..

Code: Select all

/home/ricardo/bin/android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.8/include/bits/hashtable.h:1329: error: undefined reference to 'std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned int, unsigned int, unsigned int) const'
That suggests you're using gcc 4.8 for your ndk builds. Note that the ndk compiler does not necessarily match up with your system compiler.

As for the problem at hand, when you changed your compiler flags, did you first clean the build directory? These kinds of errors may be caused by switching the configuration mid-compile.

Re: Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 3:10 pm
by gomez
bartbes wrote:
gomez wrote: I'm using GCC 4.9..

Code: Select all

/home/ricardo/bin/android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.8/include/bits/hashtable.h:1329: error: undefined reference to 'std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned int, unsigned int, unsigned int) const'
That suggests you're using gcc 4.8 for your ndk builds. Note that the ndk compiler does not necessarily match up with your system compiler.

As for the problem at hand, when you changed your compiler flags, did you first clean the build directory? These kinds of errors may be caused by switching the configuration mid-compile.
when I pasted the error in pastebin I realized that he was using 4.8 version of gcc.. my mistake T-T
However, gcc 4.8 is compatible with C ++ 11. (I guess)

about cleaning,
every time I try to compile again I run 'ndk-build clean' command.. so i guess that it's not the problem
I tried clang instead of gcc, but it returns a bug in the build process.
I have also tried another version of android ndk. The proposal by the tutorial is 9c, which is what's giving this error. I also tested with the 10e, the latest, and returns the same error :/
(from what I've already googled, the error is related to my environment, which is weird because I did exactly what was written in the tutorial)

:cry: :cry: :cry:

Re: Error when trying to compile LÖVE-Android

Posted: Tue Jul 14, 2015 6:36 pm
by fysx
Hrm... I'm using NDK R10d and GCC 4.8 at the moment without any problems. Maybe you have incompatible environment variables for the NDK?

Re: Error when trying to compile LÖVE-Android

Posted: Wed Jul 15, 2015 1:14 am
by gomez
HOLY CRAP
I MADE IT !
(excuse the expression, but i'm really really happy :D)

For some reason the standard compiler of my system was the clang instead of gcc, and when I tried to compile with the ndk-build, it mingled gcc and clang. WHOA, what a mess :death:
but beyond that, I needed to add a variable to Application.mk, in the 'jni' folder:

Code: Select all

NDK_TOOLCHAIN_VERSION := 4.8

So, thank you guys, you are awesome :D

Re: [SOLVED] Error when trying to compile LÖVE-Android

Posted: Wed Jul 15, 2015 9:11 am
by fysx
Thanks for the feedback. Just committed a change that enforces gcc 4.8 from now on.