[erlang-questions] Use of makefiles

Per Hedeland per@REDACTED
Mon Mar 10 23:29:02 CET 2008


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