I have this source sockets.c code :
void socket_error()
{
WINDOW *werror;
int car;
initscr();
werror = newwin(10,15,5,20);
scrollok(werror,TRUE);
wtimeout(werror,350);
keypad(werror,TRUE);
car = ERR;
while(car == ERR)
{
switch(car=wgetch(werror))
{
case ERR:
{
wprintw(werror, "TOUCHE");
break;
}
default :
{
delwin(werror);
endwin();
}
}
}
}
int socket_open(nb_arg)
int nb_arg;
{
char HostName[80];
int PortNum;
struct sockaddr_in sa;
struct hostent *hp;
int s;
if (nb_arg != 2)
fgl_fatal(__FILE__, __LINE__, -1318);
else
{
popint(&PortNum);
popvchar(HostName, sizeof(HostName));
if ( (hp = gethostbyname(HostName)) == NULL)
socket_error();
.
.
.
}
retint(s);
retint(errno);
return(2);
}
My Main.4GL code :
MAIN
DEFINE no_socket INTEGER
DEFINE no_error INTEGER
CALL socket_open("I016",3000) RETURNING no_socket, no_error
END MAIN
I compil with the syntax :
c4gl main.4gl sockets.c -o test.4ge -lsocket -lcurses
I have the errors :
ld: Symbol wrefresh in /usr/informix/lib/libnforms.a is multiply defined.
First
defined in /usr/lib/libcurses.a
ld: Symbol _endwin in /usr/informix/lib/libnforms.a is multiply defined.
First d
efined in /usr/lib/libcurses.a
ld: Symbol tputs in /usr/informix/lib/libnforms.a is multiply defined. First
def
ined in /usr/lib/libcurses.a
ld: Symbol newwin in /usr/informix/lib/libnforms.a is multiply defined.
First de
fined in /usr/lib/libcurses.a
If I compil with the syntax :
c4gl main.4gl sockets.c -o test.4ge -lsocket
No errors with 'ld' but a big core dump when I run test.4ge.
How can I resolve it ? How may I display a window in C source ?
Regards