www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/16/03:35:16

Date: Sun, 16 Feb 1997 10:14:20 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gregary J Boyles <boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: PDCurses problem.
In-Reply-To: <5e61q8$sbf@lion.cs.latrobe.edu.au>
Message-ID: <Pine.SUN.3.91.970216100802.15352A-100000@is>
MIME-Version: 1.0

On 16 Feb 1997, Gregary J Boyles wrote:

> Trying to link curses into a program.
> Command line was : gxx -otest.exe test.cc string.o curswin.cc -lcurs
> 
> Produced : 
> 
> In file included from curswin.hh:18,
>                  from test.cc:55:
> d:/djgpp/include/curses.h:426: warning: abstract declarator used as declaration
> In file included from curswin.hh:18,
>                  from curswin.cc:14:
> d:/djgpp/include/curses.h:426: warning: abstract declarator used as declaration
> C:\DOS\ccdaaaaa(.text+0x152):test.cc: undefined reference to `werase(_win *)'
[snip]
> What does the c:\dos\cceaaaaa nonsense mean and why can't the compiler
> find the functions?

That's not nonsense, these are the names of the temporary files gcc uses 
to compile and link your program.

The cause of your problem is that curses.h is not C++-aware.  You should 
edit it to add the usual ``extern "C" {....}'' wrapper around all the 
function prototypes.  Look in all the other header files in your include/ 
directory for an example.

> Also how would I rebuild the curses archive file (libcurs.a) from all the
> object files.

Doesn't the PDCurses distribution include a Makefile?  If so, it should 
already include a command to generate the library; just use it and you 
will save yourself a lot of grief.

> I read the info page for ar and it is useless because it has
> no examples. I tried dozens of command lines but ar did not recognize any
> of them.

Here's how:

	ar rvs libcurses.a file1.o file2.o ....

> The info pages don't properley explain how to pass the options
> and file names to ar.

The info docs are from the GNU project.  Please submit a bug report to 
bug-gnu-utils AT prep DOT ai DOT mit DOT edu.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019