Noorez Kassam wrote:
> But why can't i just say -lmyf paramater to add to the linker. The
> linker says that it couldn't find it but i told the compiler where to
> look for my other libraries.
Let's start again from the begining.
First you create a library with the filename "libmyf.a". Then consider
you put in the directory "C:\foo".
So now you create an app and want to link to this library. Then you call
the compiler like this:
gcc program.c -o program.exe -lmyf -L"c:\foo"
Does it work now?
By the way, you don't need to add the default directories (include and
lib). The compiler will search in the default dirs (like ../include and
../lib) automatically. The only directory I have configured on my
Dev-Cpp is the binaries because this last version requires this.
Also a good idea is to add your c:\dev-cpp\bin (if you installed it
there) to your PATH environment variable (unless you think it'll polute
another compiler environment, like cygwin) so you can call gcc like in
my example in any console window (but is much more warm and cozy to do
it in a *nix shell, like MSYS :P ).
Daniel K. O.
|