[erlang-questions] Use of makefiles

Bengt Kleberg bengt.kleberg@REDACTED
Tue Mar 11 08:20:07 CET 2008


Greetings,

Thank you for the clarification.

FWIW: I promise that I do know that -l is for the linker. That is why I
wrote "compiling/linking". For some reason that I have forgotten, but it
sounded really convincing at the time, I was told to always use the C
compiler to handle the linking. Therefore I do not know what the SUN and
GNU linkers are called, so that is why I wrote SUN C/gcc.

At the time I thought it would save some writing. My mistake.


bengt

On Mon, 2008-03-10 at 23:29 +0100, Per Hedeland wrote:
> Bengt Kleberg <bengt.kleberg@REDACTED> wrote:
> >
> >Still OT since we are now talking about C compiling/linking.
> >
> >Since gcc does not need the -lsocket that the SUN C compiler needs for
> >sockets, I think that these differences show up long before the project
> >turns highly unusual.
> 
> Not sure if it matters much for the discussion, but differences in
> required libraries are generally (always?) dependent on the OS, not the
> compiler. On Solaris, which is probably the only place you use the Sun C
> compiler, you need -lsocket, whereas on most OSes where gcc is the
> "standard" compiler, you don't - which is probably the source of your
> misunderstanding.
> 
> --Per Hedeland
> 
> $ uname -sr
> SunOS 5.10
> $ echo 'main(){socket();}' > xxx.c
> $ gcc xxx.c
> Undefined                       first referenced
>  symbol                             in file
> socket                              /var/tmp//ccQwllM5.o
> ld: fatal: Symbol referencing errors. No output written to a.out
> collect2: ld returned 1 exit status
> $ gcc xxx.c -lsocket
> $
> 




More information about the erlang-questions mailing list