Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: JessH on July 29, 2010, 10:21:46 am
-
Hi guys I'm new to c++ programming and after a few days trying different IDEs I've chosen C::B.
I have been writing some simple stuff and it was all ok until i needed to use some other libraries. I guess it has to do with setting the path or something like that. I tried this :
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F
but it doesn't seem to work. I did that and added a lot of folders, I even tried with adding all the folders in the tree one by one, but when I try to compile my program C::B doesn't find the functions that I call. The error says "undefined reference to XXfuncion ".
I also tried searching in the forum but I got nothing :( , I hope I posted this in the right place and wish you can help me ^^
Edit :I'm using suse and C::B 10.05 (Debugger 0.3 compiler 0.99)
-
Did you also add the librar(y)(ies) to the "Link libraries:" in the projects/targets "Linker settings" ?
-
I can't find that option. If you mean settings>debugger and compiler>linker settings tab , yes I did.
I'm trying to fin that projects/target option now ...
-
"Project -> Build options -> Linker settings -> Link libraries"
-
OK I found it thanks. It was empty. Though I don't have a .a .so .lib or so to add , I installed the library from source and I got the .cpp .hpp .o ... is there any other way ?
In Konsole when I g++ specifying -l and the library name it works fine
-
Still doesn't work ... any other idea ? :(
-
Thanks for the help ....
Anyway i solved this :
Settings > Compiler and debugger > global compiler settings > linker settings
In 'link libraries' press 'add' and type the name of the library , in my case it was curl and curlpp.
-
Thanks for the help ....
Anyway i solved this :
Settings > Compiler and debugger > global compiler settings > linker settings
In 'link libraries' press 'add' and type the name of the library , in my case it was curl and curlpp.
The above is an example of the wrong way to do things; sometimes in the future this person
will asked us why is the libraries curl and curlpp always being linked in my new projects.
Tim S.
-
Hi Tim, if that is the wrong way to do it why don't you show me the right one ? I posted several times that jens' solution didn't work and still got no help. So please if you know the answer post it for future users and stop being so overbearing :wink: no offence
-
Do you have a project?
-
If you do not have a project, my solution will not work, and using the global compiler settings is all you can do, even if it will probably lead to errors later as Tim wrote.
My solution does exactly the same as using global settings, that are common to all projects and files, but on project level.