Mail Archives: djgpp/1996/04/25/14:53:36
root wrote:
> Ok, I boiled it down to a simplisimus curses program:
> ( the real program is about 32k so I'm not going to flood the world
> with it when a simple example has the same effect ( for me ) )
Without knowing what the error was, it's hard to say what your problem is. I'm
going to make the assumption that you're actually using the library correctly; in
that case, your problem may be that of a link problem. If you're trying to link C
code in with C++ code, you must use extern "C" { ... } around the headers that are
being included in the C++ file. The reason is because C and C++ have different
symbol naming conventions, and without the extern "C" { ... } declaration the linker
is looking for C++-named calls, when in fact they will be C-named calls.
If curses.h doesn't contain the extern "C" { ... } identifiers, the easiest way to
get it done is in your C++ program to include curses.h as:
extern "C" {
#include <curses.h>
}
(I don't know whether the curses library you're using already has the extern "C" {
.... } under a conditional compilation clause, but I'm guessing that it doesn't.)
--
Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max AT alcyone DOT com
San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
"Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
- Raw text -