From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: PDCurses Compiling Problems. Date: Sat, 23 Nov 1996 23:15:10 -0800 Organization: Three pounds of chaos and a pinch of salt Lines: 35 Message-ID: <3297F5FE.1E44@cs.com> References: <199611240023 DOT WAA16859 AT cosmos DOT hiway DOT gr> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp102.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Panos Platon Tsapralis To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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 and b) > in . What should I do to overcome the problem ? I'm not sure about this, but you may want to comment out the #include 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 | ---------------------------------------------------------------------