Problem compiling Dynamic C++ Libray
Posted: Sat Jul 04, 2015 2:45 pm
Hi there guys,
just installed CL. Looks great and way better than C::B. However, I just started creating a Dynamic C++ Library (it barely has 2 classes so far), but cannot get it to compile. The following log is issued:
/bin/sh -c '/usr/bin/make -j8 -e -f Makefile'
----------Building project:[ InsomniaEngine - Debug ]----------
make[1]: Entering directory '/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine'
/usr/bin/g++ -c "/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine/Node.cpp" -g -o ./Debug/Node.cpp.o -I. -I.
/usr/bin/g++ -c "/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine/Stage.cpp" -g -o ./Debug/Stage.cpp.o -I. -I.
/usr/bin/g++ -shared -fPIC -o ./Debug/InsomniaEngine.so @"InsomniaEngine.txt" -L.
/usr/bin/ld: ./Debug/Stage.cpp.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
./Debug/Stage.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
InsomniaEngine.mk:76: recipe for target 'Debug/InsomniaEngine.so' failed
make[1]: *** [Debug/InsomniaEngine.so] Error 1
make[1]: Leaving directory '/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
1 errors, 0 warnings
I can't really find where I've gone wrong if I have, but I'm guessing it has something to do with the line:
/usr/bin/ld: ./Debug/Stage.cpp.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
Can anyone help me out on how to solve this problem?
Thanks a lot beforehand
just installed CL. Looks great and way better than C::B. However, I just started creating a Dynamic C++ Library (it barely has 2 classes so far), but cannot get it to compile. The following log is issued:
/bin/sh -c '/usr/bin/make -j8 -e -f Makefile'
----------Building project:[ InsomniaEngine - Debug ]----------
make[1]: Entering directory '/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine'
/usr/bin/g++ -c "/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine/Node.cpp" -g -o ./Debug/Node.cpp.o -I. -I.
/usr/bin/g++ -c "/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine/Stage.cpp" -g -o ./Debug/Stage.cpp.o -I. -I.
/usr/bin/g++ -shared -fPIC -o ./Debug/InsomniaEngine.so @"InsomniaEngine.txt" -L.
/usr/bin/ld: ./Debug/Stage.cpp.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
./Debug/Stage.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
InsomniaEngine.mk:76: recipe for target 'Debug/InsomniaEngine.so' failed
make[1]: *** [Debug/InsomniaEngine.so] Error 1
make[1]: Leaving directory '/home/dccdn/Repositories/InsomniaEngine/InsomniaEngine'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
1 errors, 0 warnings
I can't really find where I've gone wrong if I have, but I'm guessing it has something to do with the line:
/usr/bin/ld: ./Debug/Stage.cpp.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
Can anyone help me out on how to solve this problem?
Thanks a lot beforehand