Fail to compile with gcc5

Talk about anything concerning the source code.
Post Reply
c-101
Posts: 3
Joined: Fri Dec 11, 2015 3:32 pm

Fail to compile with gcc5

Post 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
cajuil
Posts: 11
Joined: Sat Jan 23, 2016 9:39 am

Re: Fail to compile with gcc5

Post 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!
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Fail to compile with gcc5

Post by Matlo »

Thanks for sharing!

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