I'm trying to compile a shared library (windows equivalent of a .dll) and it gives me the following error:
usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: error adding symbols: Bad value
I've never seen this error before. Ever. I'm using codeblocks and g++ 4.8.1. What causes this error?
I'm compiling my own code using:
g++ -shared obj/Debug/src/Bitmap.o obj/Debug/src/Exports.o obj/Debug/src/Hooks.o obj/Debug/src/main.o obj/Debug/src/Platform.o obj/Debug/src/SharedMemory.o obj/Debug/src/SmartJNI.o -o bin/Debug/libGLXColour.so -libGL.so -pthread
/usr/bin/ld: obj/Debug/src/Bitmap.o