The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to call c executable inside c program?? zedex High Level Programming 9 05-15-2009 12:58 PM
What's The Easiest Route To Creating A Unix Executable File for Terminal? unimachead OS X (Apple) 10 11-03-2008 12:40 PM
creating executable for every C file compbug UNIX for Dummies Questions & Answers 7 09-30-2007 05:03 PM
launch an executable from a C++ program nadiamihu High Level Programming 2 11-03-2006 05:59 AM
Creating a client handle in RPC pic High Level Programming 1 05-02-2006 11:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-17-2006
konas konas is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 1
problem in creating executable for a client program

Hi,
I am trying to run simple client server c program in unix.At the compling stage server is creating an executable but the client is not.

below is the link to the source codes:
http://www.cs.rpi.edu/courses/sysprog/sockets/server.c
http://www.cs.rpi.edu/courses/sysprog/sockets/client.c

I am getting following message

client.c: In function `main':
client.c:39: warning: passing arg 2 of `connect' from incompatible pointer type
client.c:53:2: warning: no newline at end of file
Undefined first referenced
symbol in file
gethostbyname /var/tmp//ccgXDT5X.o (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to ss1
collect2: ld returned 1 exit status

Can any one solve this?
  #2 (permalink)  
Old 11-17-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,790
First off this looks like homework - which is not allowed on the forums.

Second, you have a linker error. This means that the command you used to compile the code either could not find the correct library (a .so file or a .o file or a .a file), or the library does not exist on your machine, or a library is old and doesn't have the symbol (another name for a function) in it.
  #3 (permalink)  
Old 11-17-2006
!_30's Avatar
!_30 !_30 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Romania
Posts: 37
Hey dude , I've just compiled your client source code , and it's working fine , except .. go and modify this : ( on connect ).


Code:

 if (  connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0)

                error("ERROR connecting");

Don't forget , to include the red thing ..


P.S : I have try to program ..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0