Need help w/ compile error 
Author Message
 Need help w/ compile error

    Would someone please give me some clues how to fix this undefined
symbol error.

SunOS/~ 33% cc -o intest intest.c
Undefined                       first referenced
 symbol                             in file
socket                              intest.o
gethostbyname                       intest.o
send                                intest.o
inet_addr                           intest.o
connect                             intest.o
ld: fatal: Symbol referencing errors. No output written to wnuke



Tue, 09 Nov 1999 03:00:00 GMT  
 Need help w/ compile error


Quote:
>    Would someone please give me some clues how to fix this undefined
>symbol error.
>SunOS/~ 33% cc -o intest intest.c
>Undefined                       first referenced
> symbol                             in file
>socket                              intest.o
>gethostbyname                       intest.o
>send                                intest.o
>inet_addr                           intest.o
>connect                             intest.o
>ld: fatal: Symbol referencing errors. No output written to wnuke

None of the missing symbols is a symbol that must be defined by
the standard C library. For your particular system, I'm quite
sure that "man" tells you which libraries need to be linked
to satisfy the unsatisfied references.

Network programming is well beyond the scope of comp.lang.c, but
might be a good topic in comp.unix.programmer.

Kurt

--
| Kurt Watzka                             Phone : +49-89-2180-6254



Tue, 09 Nov 1999 03:00:00 GMT  
 Need help w/ compile error

Quote:


> >    Would someone please give me some clues how to fix this undefined
> >symbol error.

> >SunOS/~ 33%
> >Undefined                       first referenced
> > symbol                             in file
> >socket                              intest.o
> >gethostbyname                       intest.o
> >send                                intest.o
> >inet_addr                           intest.o
> >connect                             intest.o
> >ld: fatal: Symbol referencing errors. No output written to wnuke

> None of the missing symbols is a symbol that must be defined by
> the standard C library. For your particular system, I'm quite
> sure that "man" tells you which libraries need to be linked
> to satisfy the unsatisfied references.

> Network programming is well beyond the scope of comp.lang.c, but
> might be a good topic in comp.unix.programmer.

> Kurt

> --
> | Kurt Watzka                             Phone : +49-89-2180-6254


You'll need to link your code at compile time with two libraries:
libsocket.a and libnsl.a.  Do this lik so:

        cc intest.c -o intest -lsocket -lnsl

That should do it and resolve any external references you have.

                                        Steve



Wed, 10 Nov 1999 03:00:00 GMT  
 Need help w/ compile error


Quote:

> [cut some lines]
>>SunOS/~ 33% cc -o intest intest.c

  ^^^^^ try comp.unix.solaris or something like that.

I know the answer, but in comp.lang.c you won't get my answer :)

Quote:
>>ld: fatal: Symbol referencing errors. No output written to wnuke

                                                             ^^^^^
Kurt, you missed this last line. Recognize the name?

This is a Winblows programmer trying to be cute on Unix. A mischevious
one at that. Will we help him (her? I'm not *that* firm in asian names)?
Nah...

Quote:
>None of the missing symbols is a symbol that must be defined by
>the standard C library. For your particular system, I'm quite
>sure that "man" tells you which libraries need to be linked
>to satisfy the unsatisfied references.

What makes you think a Windows programmer knows how to use "man"...

Quote:
>Network programming is well beyond the scope of comp.lang.c, but
>might be a good topic in comp.unix.programmer.

            ^^^^

Good topic? I wonder...

Quote:
>Kurt

>--
>| Kurt Watzka                             Phone : +49-89-2180-6254


Michael
--
Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam (For non-latiners: "I have a catapult. Give me all the
money, or I will fling an enormous rock at your head.")


Thu, 18 Nov 1999 03:00:00 GMT  
 Need help w/ compile error

Quote:



>> [cut some lines]
>>>SunOS/~ 33% cc -o intest intest.c
>  ^^^^^ try comp.unix.solaris or something like that.

>I know the answer, but in comp.lang.c you won't get my answer :)
>>>ld: fatal: Symbol referencing errors. No output written to wnuke
>                                                             ^^^^^
>Kurt, you missed this last line. Recognize the name?

No, but what has the name got to do with it. Given the number of
programs in existence, what can be derived from a program name.
Just because you seem to know another program with that name, it
is less than obvious that this is the same program, or that it
targets a certain platform.

Quote:
>This is a Winblows programmer trying to be cute on Unix. A mischevious
>one at that. Will we help him (her? I'm not *that* firm in asian names)?
>Nah...
>>None of the missing symbols is a symbol that must be defined by
>>the standard C library. For your particular system, I'm quite
>>sure that "man" tells you which libraries need to be linked
>>to satisfy the unsatisfied references.
>What makes you think a Windows programmer knows how to use "man"...

The fact that (s)he uses a compiler on a Solaris installation, or
at least pretends to do so.

Quote:
>>Network programming is well beyond the scope of comp.lang.c, but
>>might be a good topic in comp.unix.programmer.
>            ^^^^
>Good topic? I wonder...

Well, if you know about a better newsgroup for sockets programming,
clue us in. I still don't see a good reason to assume that Thang is
having problems with Windows programming.

Kurt

--
| Kurt Watzka                             Phone : +49-89-2180-6254



Fri, 19 Nov 1999 03:00:00 GMT  
 Need help w/ compile error



Quote:
>>Network programming is well beyond the scope of comp.lang.c, but
>>might be a good topic in comp.unix.programmer.
>            ^^^^

>Good topic? I wonder...

That's where you'll find the socket FAQ.

--
-----------------------------------------


-----------------------------------------



Fri, 19 Nov 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Need Help - NetServerEnum compile error

2. Need help with compile error

3. Compile Error=> Need help from expert

4. compiling error, need help

5. VC 5.0 Compile Errors (compiles fine with 4.2)

6. HELP: Need Help on Error (Undefined Symbol...)

7. HELP: Need Help on Error (Undefined Symbol...)

8. need help compiling vc++6 project in vC++.Net

9. TIME FUNCTION -- NEED help compiling

10. I need help on this compile warning message..

11. Need Help compiling M

12. Need Help compiling Microsoft C with Borland C

 

 
Powered by phpBB® Forum Software