From owner-freebsd-current Tue Jun 18 22:58:44 2002 Delivered-To: freebsd-current@freebsd.org Received: from angmar.mel.vet.com.au (angmar.mel.vet.com.au [203.39.245.7]) by hub.freebsd.org (Postfix) with ESMTP id D449537B41D for ; Tue, 18 Jun 2002 22:58:27 -0700 (PDT) Received: from nargothrond.ca.com (nargothrond.ca.com [155.35.178.10]) by angmar.mel.vet.com.au (Postfix) with ESMTP id 01A9914F303 for ; Wed, 19 Jun 2002 15:58:15 +1000 (EST) Received: from ca.com ([155.35.178.101]) by nargothrond.ca.com with esmtp; Wed, 19 Jun 2002 15:57:51 +1000 Message-ID: <3D101D73.607@ca.com> Date: Wed, 19 Jun 2002 15:58:11 +1000 From: Lachlan O'Dea Organization: Computer Associates User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@FreeBSD.ORG Cc: Charlie Root Subject: Re: C++ troubles continue References: <200206190212.g5J2CJ6q093342@aldan.algebra.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Charlie Root wrote: > Trying to build kdebase3 on the > FreeBSD 5.0-CURRENT #7: Mon Jun 17 22:46:16 EDT 2002 > > [...] > gmake[4]: Nothing to be done for `all-am'. > gmake[4]: Leaving directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1/kappfinder/apps' > gmake[3]: Leaving directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1/kappfinder/apps' > gmake[3]: Entering directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1/kappfinder' > /bin/sh ../libtool --mode=link --tag=CXX c++ -DNDEBUG -DNO_DEBUG -O2 -O -march=i686 -pipe -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o kappfinder -L/opt/lib -pthread -L/opt/lib -R /opt/lib -R /opt/lib -R /opt/lib -R /opt/lib main.o scanner.o checker.o kappfinder_meta_unload.o -lkdeui > c++ -DNDEBUG -DNO_DEBUG -O2 -O -march=i686 -pipe -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o kappfinder -pthread main.o scanner.o checker.o kappfinder_meta_unload.o -L/opt/lib /opt/lib/libkdeui.so /opt/lib/libkdecore.so -L/usr/lib /opt/lib/libDCOP.so /opt/lib/libkdefx.so -lqt-mt -lpng -lz -lXext -lX11 -lSM -lICE -lXrender -lstdc++ -lm -lgcc -Wl,--rpath -Wl,/opt/lib -Wl,--rpath -Wl,/opt/lib > checker.o: In function `checkDesktopFile(QString const&, QString)': > checker.o(.text+0x536): undefined reference to `cout' > checker.o(.text+0x543): undefined reference to `ostream::operator<<(char const*)' > checker.o(.text+0x575): undefined reference to `ostream::operator<<(char const*)' > checker.o(.text+0x585): undefined reference to `ostream::operator<<(char const*)' > checker.o(.text+0x6f1): undefined reference to `cout' > checker.o(.text+0x6fe): undefined reference to `ostream::operator<<(char const*)' > checker.o(.text+0x706): undefined reference to `endl(ostream&)' > checker.o(.text+0x7e1): undefined reference to `cout' > checker.o(.text+0x7ea): undefined reference to `ostream::operator<<(char const*)' > checker.o(.text+0x7f2): undefined reference to `endl(ostream&)' > gmake[3]: *** [kappfinder] Error 1 > gmake[3]: Leaving directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1/kappfinder' > gmake[2]: *** [all-recursive] Error 1 > gmake[2]: Leaving directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1/kappfinder' > gmake[1]: *** [all-recursive] Error 1 > gmake[1]: Leaving directory `/ccd/ports/x11/kdebase3/work/kdebase-3.0.1' > gmake: *** [all] Error 2 > *** Error code 2 > > Any clues? The /usr/lib/libstdc++.a has, for example: > > 00000000 W std::basic_ostream >& std::endl >(std::basic_ostream >&) > 00000000 B std::cout > 00000000 B std::buf_cout > U std::cout > U std::buf_cout I have the same problem exactly. All I could work out is that it's due to checker.cpp including the old-fashioned iostream.h instead of iostream. You can patch it to make it build easily enough... --- checker.cpp.orig Wed Jun 19 15:49:04 2002 +++ checker.cpp Wed Jun 19 15:49:19 2002 @@ -20,7 +20,9 @@ #include #include -#include +#include + +using namespace std; #include ... but I doubt that's a good idea. I haven't been able to find a library anywhere on my system that exports the symbols I get when including iostream.h. Perhaps my -current build is incomplete for some reason. Here's an ultra-simple test case if it helps anyone: fornost ~/tmp % cat test.cpp #ifdef OLDE_STYLE #include #else #include using namespace std; #endif int main() { cout << "Hello, world." << endl; return 0; } fornost ~/tmp % c++ -o test -Wall test.cpp fornost ~/tmp % ./test Hello, world. fornost ~/tmp % c++ -o test -Wall -DOLDE_STYLE test.cpp /var/tmp//ccjRtwx3.o: In function `main': /var/tmp//ccjRtwx3.o(.text+0x14): undefined reference to `endl(ostream&)' /var/tmp//ccjRtwx3.o(.text+0x21): undefined reference to `cout' /var/tmp//ccjRtwx3.o(.text+0x26): undefined reference to `ostream::operator<<(char const*)' /var/tmp//ccjRtwx3.o(.text+0x2f): undefined reference to `ostream::operator<<(ostream& (*)(ostream&))' fornost ~/tmp % uname -a FreeBSD fornost.ca.com 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Wed Jun 12 18:39:45 EST 2002 odela01@fornost.ca.com:/usr/src/sys/i386/compile/FORNOST i386 -- Lachlan O'Dea Computer Associates Pty Ltd Webmaster Vet - Anti-Virus Software http://www.vet.com.au/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message