Mail Archives: djgpp/1997/12/22/05:47:07
Thomas Likens schrieb:
>
> command-line make file compiles and links correctly with the following
> order:
>
> gcc program.o -lcurso -o program.exe -Lc:/djgpp/contrib/pdcurs22/lib
>
> But regardless of how I manipulate the various menu options regarding
> both the linker and the compiler RHIDE invokes it as:
>
> gcc -Lc:/djgpp/contrib/pdcurs22/lib -Xlinker -lcurso -o program.exe
> program.o
>
> Even with some manipulation I can only get
>
> gcc -Xlinker -lcurso -Lc:/djgpp/contrib/pdcurs22/lib -o program.exe
> program.o
>
> Both of these last variations cause the linker to fail because it
> can't resolve the references to the curses functions in the program.
That´s clear, since the GNU linker is a one-pass-linker and it
sees at first the library and _after_ this the object file, which needs
functions from the library but now the linker has forgotten the
library.
> Does anyone know a workaround for this or a simple setting inside of
> RHIDE that I am missing. I would really like to get this going inside
> the IDE.
Of course I know. Your fault is, that you have placed the the -lcurso
option
in the "Options/Linker options", but this entry should be used _only_
for some special options which you want to to pass to the linker (like
-s or --cref or ...). To tell RHIDE to link in your program a library
there
is an other menu entry with a very "confusing" :-) name
"Options/Libraries".
Simply add there in an empty line (propably the first) your library name
(without the lib and the .a), in your case only curso, and then turn
the checkbox before it on. Now it should work.
The commandline which RHIDE uses now to link your program should be
gcc -Lc:/djgpp/contrib/pdcurs22/lib -o program.exe program.o -lcurso
Robert
--
******************************************************
* email: Robert Hoehne <robert DOT hoehne AT gmx DOT net> *
* Post: Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW: http://www.tu-chemnitz.de/~sho/rho *
******************************************************
- Raw text -