Mail Archives: djgpp/2003/11/19/11:23:59
Wolfgang Schlegel <wolfgang DOT schlegel AT arcor DOT de> tuvo a bien
escribir:
> Hi newsgroup,
>
> a problem I can't solve deals with gcc's lib search path. I try
> the command line
>
> gcc test.cpp -o test.exe libm.a
>
> and get
>
> gcc.exe: libm.a: No such file or directory (ENOENT)
>
> The lib exists in c:\djgpp\lib, and if I explicitly type
>
> gcc test.cpp -o test.exe c:\djgpp\lib\libm.a
>
If I understand correctly, you are trying to link the mat library,
right?
> it works fine. Options -l and -L don't yield any result too.
Because you need invoke option l in the following form:
gcc test.cpp -o test.exe -lm
i.e, you omit the 'lib' prefix, and the part '.a' of the name of
library.
> From the FAQ I believe to know gcc.exe uses an environment
> variable called LIBRARY_PATH. I set this to the appropiate
> directory, but gcc didn't find it's libs. I read about the
> syntax for djgpp.env, had a look on this file, was surprised to
> see all directory names there seem to be converted to UNIX ( \
> to / ), tried to avoid this conversion, and gcc.exe again
> didn't find it's libs. For the moment I'm out of ideas. Thank
> you for aid,
>
> Wolfgang
This info appears in the FAQ. See question 8.8 'Undefined
references when linking programs'
HTH
Jose L. Sanchez Garrido
'I don't know' -Isaac Asimov
- Raw text -