From owner-freebsd-hackers Sun Mar 31 12:28:23 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id AC82B37B400 for ; Sun, 31 Mar 2002 12:28:18 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g2VKSHi46383; Sun, 31 Mar 2002 13:28:17 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g2VKSGf51555; Sun, 31 Mar 2002 13:28:16 -0700 (MST) (envelope-from imp@village.org) Date: Sun, 31 Mar 2002 13:27:30 -0700 (MST) Message-Id: <20020331.132730.48528141.imp@village.org> To: corecode@corecode.ath.cx Cc: hackers@FreeBSD.ORG Subject: Re: bsd.prog.mk doesn't link c++ programs correctly? From: "M. Warner Losh" In-Reply-To: <20020330081410.5af6f2da.corecode@corecode.ath.cx> References: <20020330081410.5af6f2da.corecode@corecode.ath.cx> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <20020330081410.5af6f2da.corecode@corecode.ath.cx> "Simon 'corecode' Schubert" writes: : hi hackers! : : i'm in progress in writing a c++ program utilizing bsd.prog.mk : : i wondered why my programs won't link correctly when i don't add a line : LDFLAGS=-lstdc++ : no i was trying out gcc30 (whoa, slow!) and it didn't want to link with : or without the above line. : : it seems c++ programs need to be linked via g++ (or c++). : after delting the above line and inserting a : CC=${CXX} : everything works fine, but that's not nice, of course. : : is there any specific reason why linking is done with ${CC}? : there should be a way to tell that one needs ${CXX} for linkage. I think that it is very difficult to tell if a program is a C++ program easily, so the CC hack is what is generally used. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message