LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Library Linking problem (https://www.linuxquestions.org/questions/linux-software-2/library-linking-problem-415070/)

IronBeagle 02-13-2006 05:16 PM

Library Linking problem
 
The problem is that I don't know how.

I want to work mainly with Anjuta IDE and FLTK. I've read Anjuta's site on how to link libraries but I seem to get nothing.

I'm a little miffed by the whole thng. Can someone talk to me like a grade schooler and help me link the necessary libraries?

Many thanks!


PS
If you work with KDevelop, please tell me also I would be interested in using it too!

My project is in C++ and FLTK.
FLTK is installed by default on my distro so I know everything is in there.

foo_bar_foo 02-13-2006 10:37 PM

ok
c++ shared library basics
if you already have compiled the object file for your source code but not linked
g++ -o myApp Myapp.o -L/path/to/shared/lib -lsharedlib
to do it all in one swoop
g++ -o myApp Myapp.c -L/path/to/shared/lib -lsharedlib

where sharedlib is in the directory described in the path after -L
and is named libsharedlib.so

there are always some odd situations but thats it in a gnutshell

IronBeagle 02-13-2006 11:40 PM

Thank you,

but could you tell me how to do it through Anjuta IDE?
They have about three or four different things to do to link against libraries.

Thanks in advance.

johnMG 02-14-2006 12:10 PM

No idea how to do it through Anjuta. Nor do I know how to do that with Eclipse, or (nor?) Kdevelop. I *can* however write a makefile. Regarding makefiles, it's like Han Solo said, "She may not look like much, but she's got it where it counts, kid." ;)

In general, you should first learn the actual compile/link commands themselves (as foo_bar_foo described), and only then -- only after it becomes boring 2nd-nature routine rather than a daunting and confusing task -- should you resort to automatic build tools.

Take the time to learn make/scons/jam/ant/whatever, and type in the g++ commands into your build files yourself. You'll be glad you learned.

http://wiki.linuxquestions.org/wiki/...lated_Commands
http://wiki.linuxquestions.org/wiki/...ands_and_Files


All times are GMT -5. The time now is 09:30 PM.