Page 1 of 1

Fail to compile with gcc5

Posted: Fri Dec 11, 2015 3:49 pm
by c-101
I was trying to compile GIMX in a debian sid box with gcc5 and it turns out that some functions that are defined as inline do not get linked correctly because of a change in semantics in inline for GCC5 (more details: https://gcc.gnu.org/gcc-5/porting_to.html )

Removing the inline declaration or using the old c89 semantics solves the issue

Re: Fail to compile with gcc5

Posted: Tue Jan 26, 2016 8:34 am
by cajuil
I ran into the same problem while trying to compile the source in Ubuntu 15.10. The default GCC version is 5.2.1.

So after searching I found a temporary solution/fix that will get the software compiled and able to run.

Here it is, so the "not-so-experienced" :geek: (like me) user can enjoy.

Open the file Makedefs (with nano or any other editor)

Look for these lines:

Code: Select all

CFLAGS += -Wall -Wextra -Wno-unused-parameter -s -O3
CXXFLAGS += -Wall -Wextra -Wno-unused-parameter -s -O3
Replace them with this:

Code: Select all

#Force GNU89 inline semantics
CFLAGS += -Wall -Wextra -Wno-unused-parameter -s -O3 -fgnu89-inline
CXXFLAGS += -Wall -Wextra -Wno-unused-parameter -s -O3
Save the file and compile! (make)

:mrgreen:

@Matlo should consider adding a ./configure script in the future for linux build purposes. Or just porting the code to GCC-5 too.

Kthx!

Re: Fail to compile with gcc5

Posted: Tue Jan 26, 2016 7:12 pm
by Matlo
Thanks for sharing!

I'll port the code to GCC 5 in a few month (when Linux Mint 18 goes out).