Mail Archives: djgpp/2001/07/29/06:09:14
On Sun, 29 Jul 2001, Gwen wrote:
> int main(void){
> initscr();
> start_color();
> return 0;
> }
>
> with gcc : gcc -o test1.exe test1.c ..\bin\libpdcurses.a
> it works
>
> with gpp (I rename test1.c to test1.cpp) : gpp -o test1.exe test1.cpp
> .\bin\libpdcurses.a
> it says me : "implicit declaration of function 'initscr(...)'' " ( and
> idem for start_color() )
>
> so what's wrong ?
You didn't include the curses.h header, so the compiler doesn't see the
prototypes of PDCurses functions. The C++ language disallows this
(unlike C, where it is not an error), so the compiler complains. If you
add a -Wall switch, the C compiler will print a warning.
- Raw text -