Page 1 of 1

error in link to myself .so

Posted: Sat Jun 19, 2010 9:56 pm
by roy
hi everybody,

I am trying to create a workspace which included two projects: "exe" and "dll", my OS is Linux(Ubuntu10.04).
my steps:
1, create a empty workspace "testcldll" under "/home/roy/desktop" folder.
2, create a dynamic library (with g+++) project "dll".
3, create a console simple executable(g++) project "exe"
4, add "-fPIC" to "dll" project compile option, build "dll" project successfully, "testcl/dll/Debug/dll.so" was create.
6, add "/home/roy/desktop/testcldll/dll/Debug/" to "exe" project "Linker->Library Path", add "dll" to "Linker->Libraries"
7, build "exe" prject, failed on error:

Code: Select all

g++ -c  "/home/roy/desktop/testcldll/exe/main.cpp" -g  -o ./Debug/main.o "-I." "-I." 
g++ -o ./Debug/exe ./Debug/main.o  "-L." "-L/home/roy/desktop/testcldll/dll/Debug/"  -ldll  
/usr/bin/ld: cannot find -ldll
attached all files of this workspace:
testcldll.zip
Any advise will be appreciated.
Thanks

BTW, I have read this page,

Code: Select all

http://codelite.org/forum/viewtopic.php?f=11&t=962
, but still can't solve my problem.

Re: error in link to myself .so

Posted: Sat Jun 19, 2010 10:35 pm
by eranif
Side note:

Does the folder really named '/home/roy/desktop' ?
or maybe '/home/roy/Desktop' (uppercase D)

I did 2 changes and it links fine on my box:
1) Change the output file name from

Code: Select all

$(IntermediateDirectory)/$(ProjectName).so
into:

Code: Select all

$(IntermediateDirectory)/lib$(ProjectName).so
The linux linker requires the SO file to be prefixed with 'lib'

2) I changed the path to use Upper Case 'D' (/home/eran/Desktop)

Eran

Re: error in link to myself .so

Posted: Sun Jun 20, 2010 5:22 am
by roy
Great! After changed the "Dll" output file name to "$(IntermediateDirectory)/lib$(ProjectName).so", it works now!
and I can use relative path "../dll/Debug/" for the "exe" Linker setting "Library Path" too.
Thank you very much.

my desktop folder name is really "desktop" (lowercase 'd') :lol: