Building the GLUI2 Library (Ubuntu)

271 Views Asked by At

I'm attempting to install the GLUI2 library.

I'm following the directions in the ReadMe which tells me to go GLUI's root directory and run Make. I get the following error :

/usr/bin/ld: Glui2/stb_image.o: relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

I tried including -fPIC in both compile lines in the makefile, and I get this error message:

/usr/bin/ld: Glui2/g2Button.o: relocation R_X86_64_32S against `_ZTV8g2Button' can not be used when making a shared object; recompile with -fPIC
Glui2/g2Button.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

I really have no idea what these errors are telling me or what I should do to resolve them.

I'm using it to build a small UI for a game I'm making in OpenGL, if you'd suggest a different library which works with GLUT, I'd appreciate those suggestions too...

1

There are 1 best solutions below

0
On BEST ANSWER

Glui2/stb_image.o is built from Glui2/stb_image.c file. Rename the file to Glui2/stb_image.cpp, and update the file name in makefile.

Then run "make clean" and again "make".

It worked for me, it seems that mixing c and cpp files doesn't work out well in this project.