>I am presently working on a port of a program
>from Solaris to Linux, Debian version 2.0.
>When compiling a number of object files to create a .so
>file as follows:
> gcc -o ./obj/libSrbClient.so obj/clAuth.o obj/clConnect.o
> obj/clExec.o obj/clMisc.o obj/clStub.o obj/srb_perror.o
> obj/dllist.o obj/clGlobal.o
>I get the message:
> /usr/lib/crt1.o(.text+0x36): undefined reference to `main'
> collect2: ld returned 1 exit status
>Can someone indicate how I solve this problem?
>Thank you for your time,
>Josef Jurek
You're actually asking gcc to make a normal executable in stead of a shared
library here. That's why the linker complains about no main entry point.
Use `ld' to generate the shared library (-shared option, see `man ld')
or use gcc and give the ld options to gcc via -Wl,.....
(I think the -shared option can even be given to gcc directly.)
I think you also have to compile your code with the -fpic option.
But I'm not so familiar with these things.
Good luck,
- Remco van den Berg
----------------------------------------------------------------------------
Philips Semiconductors B.V. tel:(+31 40 27)22031 fax:22764 Room: BE-345
----------------------------------------------------------------------------
Microsoft and Lotus Notes free. Don't send me any Microsoft attachments.
----------------------------------------------------------------------------