This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking problems with gcc and g++ on Solaris


Hello All,
   Im a newbee to the grp and to the domain.
Currently, im working on Solaris 5.8 and had to write
a simple socket program. While trying to compile it
gives the following errors:
======================================================
[vkolar1]socket>g++ server.c
/var/tmp/ccCe6VUX.o: In function `main':
/var/tmp/ccCe6VUX.o(.text+0x10): undefined reference
to `socket'
/var/tmp/ccCe6VUX.o(.text+0x54): undefined reference
to `bind'
/var/tmp/ccCe6VUX.o(.text+0x8c): undefined reference
to `listen'
/var/tmp/ccCe6VUX.o(.text+0xb0): undefined reference
to `accept'
/var/tmp/ccCe6VUX.o(.text+0xfc): undefined reference
to `recv'
collect2: ld returned 1 exit status
======================================================
However, if i try to just compile it without linking
by command "g++ -c server.c" then it doesnt give any
errors. Can someone enlighten me with this peculiar
linking problem!!!
The env LD_LIBRARY_PATH is set to
"/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib".

Thanks
Vinay Kolar

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]