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
Problem compiling Dynamic C++ Libray
-
- CodeLite Curious
- Posts: 2
- Joined: Sat Jul 04, 2015 2:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: Problem compiling Dynamic C++ Libray
Hi,
Did you try adding -fPIC to the Project Settings > Linker field?
Regards,
David
I'm sure you're right, at least for a 64bit build.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
Did you try adding -fPIC to the Project Settings > Linker field?
Regards,
David
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Problem compiling Dynamic C++ Libray
This won't help. He needs to recompile the sources with -fPIC, i.e. put it in the "Project Settings->Compiler->C++ compiler options" fieldDavidGH wrote:Did you try adding -fPIC to the Project Settings > Linker field?
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 2
- Joined: Sat Jul 04, 2015 2:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Problem compiling Dynamic C++ Libray
Damn, it worked. Thanks a lot guys. Looks like I'm gonna love this IDE.This won't help. He needs to recompile the sources with -fPIC, i.e. put it in the "Project Settings->Compiler->C++ compiler options" field
Best regards,
Dechcaudron