http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51204
Bug #: 51204 Summary: g++ does not link getaddrinfo with -lxnet on OpenIndiana Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: joh...@myrkraverk.com Created attachment 25851 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25851 Preprocessed source code that does not link with libxnet. The c++ compiler, g++, does not link the getaddrinfo symbol with libxnet. johann@asuka:C++/CompilerBugs% g++ SolarisG++4.6.2-lxnet.c++ -lxnet /var/tmp//ccDVaaGw.o: In function `main': SolarisG++4.6.2-lxnet.c:(.text+0x29): undefined reference to`__xnet_getaddrinfo' collect2: ld returned 1 exit status johann@asuka:C++/CompilerBugs(1)% On the other hand, gcc does (the file has been renamed). % gcc SolarisG++4.6.2-lxnet.c -lxnet johann@asuka:C++/CompilerBugs% The system is OpenIndiana 151a. johann@asuka:C++/CompilerBugs% uname -a SunOS asuka 5.11 oi_151a i86pc i386 i86pc This is vanilla GCC 4.6.2. johann@asuka:C++/CompilerBugs(1)% g++ --version g++ (GCC) 4.6.2 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. johann@asuka:C++/CompilerBugs% And the configure flags are: /opt/myrkraverk/src/gcc/4.6.2/configure \ --prefix=/opt/myrkraverk/gcc/4.6.2 \ --with-local-prefix=/opt/myrkraverk/include \ --with-gnu-as \ --with-as=/usr/gnu/bin/as \ --with-gnu-ld \ --with-ld=/usr/gnu/bin/ld \ --enable-version-specific-runtime-libs \ --with-gmp=/usr/gnu --with-mpfr=/usr/gnu \ --with-libiconv-prefix=/usr/gnu \ --with-ecj-jar=/opt/myrkraverk/src/gcc/ecj-4.5.jar And for the record, there is nothing in /usr/local, hence --with-local-prefix.