problem in creating executable for a client program


 
Thread Tools Search this Thread
Top Forums Programming problem in creating executable for a client program
# 1  
Old 11-17-2006
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  
Old 11-17-2006
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  
Old 11-17-2006
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 ..
Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Creating An Executable On The Fly...

Hi all... Had an idea tonight which could really enhance shell scripting for me. Yes I am aware there could be difficulties but...... Creating a C script inside the shell script to do a task, (a simple text print to stdout in this example), compiling it on the fly, making sure it is... (4 Replies)
Discussion started by: wisecracker
4 Replies

2. Shell Programming and Scripting

Creating executable script--please help

Hi group, I am very beginner in shell scripting and self learning. I am trying to create and executable script to run awk from user defined variables. e.g. suppose from a given file I want to delete some rows or some columns We need to repeat this process for many files. Thus I was... (4 Replies)
Discussion started by: smitra
4 Replies

3. UNIX Desktop Questions & Answers

creating an executable file from shell scripts

Hi Friends, I have a shell script which does some operations etc, would it be possible to create an executable file out from this shell script? meaning the executable file is not editable, thus the source code will not be visible to other users for copyright reasons. Please help, thanks! (1 Reply)
Discussion started by: kokoro
1 Replies

4. Shell Programming and Scripting

To see if a program exist and is executable

Hi, I am making a program that needs to detect if the program name in parameter is a valid runable program. But the line if ; then never seem to work. Even if I run like: ./script cat "-u" cat "-u" inputfile Thank you everyone. #!/bin/bash # usage() { #print usage message and quit... (4 Replies)
Discussion started by: leonmerc
4 Replies

5. Programming

Makefile for more than 1 executable program

Can anyone give me a makefile that creates 3 exe?for example, let's suppose i have the following files: blah1.c blah1.h blah2.c blah2.h blah3.c blah3.h i've searched and searched but so far i was not able to complete it. (4 Replies)
Discussion started by: bashuser2
4 Replies

6. Programming

Call a C programming executable inside a C program

hi guys i have only basic knowledge of C so guys plz help me ..... is C language support call the C executable inside the C ?? example contect mainA.c have a many function define in the struct,when i compile mainA and make a executable the name is ( A ),can i use executable C inside the C... (5 Replies)
Discussion started by: isnoname
5 Replies

7. Programming

how to call c executable inside c program??

hi guys i have only basic knowledge of c so guys plz help me ..... i want 2 call c executable which requires file name as argument and i need to modify file contents before calling that executable now my question is how can i call this c executable inside another c program with arguments ?? i... (9 Replies)
Discussion started by: zedex
9 Replies

8. OS X (Apple)

What's The Easiest Route To Creating A Unix Executable File for Terminal?

I've seen the executable open in the application OmniOutliner, can I create an executable with this app? I'd like to be able to create the unix executable and insert it into terminal, but I'm not sure if the Omni app will allow me to create it. Any one have any ideas or possibly familiar with... (10 Replies)
Discussion started by: unimachead
10 Replies

9. UNIX for Dummies Questions & Answers

creating executable for every C file

hello Folks, once we compile any C code on Linux, we run the code using "./a.out".. but can we have an executable for every program so that we can run the code directly without compiling the code every time. just run the executable and get the output! Thanks! (7 Replies)
Discussion started by: compbug
7 Replies

10. Programming

launch an executable from a C++ program

Hi everybody! Could you please tell me how can I launch an executable from a C++ (on unix) program? thanks in advance! (2 Replies)
Discussion started by: nadiamihu
2 Replies
Login or Register to Ask a Question