From: Stephen M. W. <ste...@cr...> - 2002-07-26 12:34:59
|
On July 26, 2002 04:55 am, Eric Chastan wrote: > > Now I manage to compile my file but I have a problem when liking, > apparently ld can't find any library I give it: > > For example I copied the libcrypt32.a from <migwdir>/lib to my > directory and tried to compile (I'm using cygwin) : > > $ ls *.c *.o *.a > ls: *.o: No such file or directory > test.c libcrypt32.a > $ g++ -oaddcert.o -c -Wno-deprecated addcert.c > $ ls *.c *.o *.a > test.c test.o libcrypt32.a > $ g++ -otest.exe -Wno-deprecated -L. -l./libcrypt32.a test.c > > c:\mingw1.1\bin\..\lib\gcc-lib\mingw32\3.1\..\..\..\..\mingw32\bin\ld >.exe: cannot find -l./libcrypt32.a Try the command line > $ g++ -o test.exe -Wno-deprecated test.c -lcrypt32 The compiler front-end will automatically prepend the lib and append the .a, and look in all the default directories and directories listed in -L directives. The current working directory, ".", is one of the default directories. -- Stephen M. Webb |