View topic - Programming Sockets

Programming Sockets

anything that doesn't fit to other groups.

Programming Sockets

Postby Drex » Tue Jul 29, 2003 5:57 pm

Can anyone help me to get a socket connected.

I am trying to open a socket in QNX neutrino for a TCP/IP stream client just a basic program so i can send information to other hardware (not running qnx). This is easy enough in Win32 or linux but is proving difficult in QNX. The compiler gives this response:

#qcc c_client.c
/tmp/AAA891811_cc.o: In function 'main'
/tmp/AAA891811_cc.o(.text+0x49): undefined reference to 'gethost by name'
/tmp/AAA891811_cc.o(.text+0x82): undefined reference to 'socket'
.....the same for all socket.h functions.....
cc: /usr/bin/ntox86-1d error1
#

I am sure i am missing something obvious!

I have included :
<sys/types.h>
<sys/socket.h>
<netinet/in.h>
<netdb.h>

Thanks.
Drex
Active Member
 
Posts: 17
Joined: Tue Jul 29, 2003 4:55 pm

Postby xtang » Tue Jul 29, 2003 5:58 pm

qcc -o c_client c_client.c -lsocket
xtang
QNX Master
 
Posts: 313
Joined: Thu Jul 18, 2002 5:01 pm

Postby Drex » Tue Jul 29, 2003 6:26 pm

xtang wrote:qcc -o c_client c_client.c -lsocket


Thanks : )

that sorted it - cheers!
Drex
Active Member
 
Posts: 17
Joined: Tue Jul 29, 2003 4:55 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron