www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/21/08:51:38

From: "jakub" <jakub AT mks DOT com DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: Converting c to cpp
Date: Thu, 21 Dec 2000 14:37:15 +0100
Organization: tp.internet - http://www.tpi.pl
Lines: 54
Message-ID: <91t0vo$1e7$1@news.tpi.pl>
NNTP-Posting-Host: mks-30.mks.com.pl
X-Trace: news.tpi.pl 977405752 1479 195.117.79.30 (21 Dec 2000 13:35:52 GMT)
X-Complaints-To: usenet AT tpi DOT pl
NNTP-Posting-Date: 21 Dec 2000 13:35:52 GMT
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi

I have a problem with convertion from c to cpp.
Simple file clear.c

_____________________
#include <curses.h>

int main(void)
{
  initscr();
  nodelay( stdscr, TRUE );
  keypad( stdscr, TRUE );
  cbreak();
  noecho();
  if (has_colors())
   start_color();

// CLS

  clear();
  refresh();

  endwin();
}
_____________________

I compile it using:
    gcc clear.c -o clear.exe -lcurso
and everything is fine.

After change clear.c to clear.cpp and compiling
    gpp clear.cpp -o clear.exe -lcurso
i've got erros:

d:/djgpp/tmp\cc0xLJtL.o(.text+0x7):clear.cpp: undefined reference to
`initscr(void)'
d:/djgpp/tmp\cc0xLJtL.o(.text+0x35):clear.cpp: undefined reference to
`start_color(void)'
d:/djgpp/tmp\cc0xLJtL.o(.text+0x49):clear.cpp: undefined reference to
`clearok(_win *, bool)'
d:/djgpp/tmp\cc0xLJtL.o(.text+0x60):clear.cpp: undefined reference to
`werase(_win *)'
d:/djgpp/tmp\cc0xLJtL.o(.text+0x8a):clear.cpp: undefined reference to
`wrefresh(_win *)'
d:/djgpp/tmp\cc0xLJtL.o(.text+0x92):clear.cpp: undefined reference to
`endwin(void)'
collect2: ld returned 1 exit status

it seems to not link curso library. Why? What to do, if I have to use c++?

Jakub


- Raw text -


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