Mail Archives: djgpp/1996/11/24/07:12:15
Panos Platon Tsapralis wrote:
>
> I try to compile the PDCurses package under DJGPP, Ver.2.01. I observe
> that the function 'ungetch(int)' is defined twice : a) in <conio.h> and b)
> in <curses.h>. What should I do to overcome the problem ?
I'm not sure about this, but you may want to comment out the #include
<conio.h> that has the "old" definition. If this causes other problems,
then you can probably safely ignore the warning.
> P.S. : In the uncompressed/expanded form of the package there is a file
> 'libcurso.a' in a directory 'lib'. When I try to compile a program,
> including in the compile command line the option -lcurso, I get an
> 'undefined reference...' message for every curses function I use.
The -l option must go at the END of the command line because ld is a
one-pass linker. When it finds a library on its command line, it
resolves any and all unresolved externals on the spot, and then discards
the rest. For example:
gcc -o prog.exe -lcurso main.o part1.o part2.o
This will not work because at the time the linker sees '-lcurso', there
are no unresolved externals. Changing the above to:
gcc -o prog.exe main.o part1.o part2.o -lcurso
will work.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -