Bug 25984

Summary: bsd.prog.mk doesn't link C++ programs properly
Product: Base System Reporter: cbond <cbond>
Component: miscAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description cbond 2001-03-22 07:30:02 UTC
bsd.prog.mk from /usr/share/mk/ doesn't properly link programs with C++ source
files against -lstdc++ as it should.  The majority of C++ programs hence fail to
build.

How-To-Repeat: 
Construct a Makefile in the standard bsd.prog.mk format and include C++ files in
the $SRCS variable (.cc, .C, .cxx, etc.).  Be sure to use a piece of the
C++ standard library in your code (e.g., iostreams).
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2002-08-19 19:45:39 UTC
Responsible Changed
From-To: freebsd-bugs->ru

Over to bsd.*.mk maintainer.
Comment 2 ru freebsd_committer freebsd_triage 2002-08-20 10:41:54 UTC
State Changed
From-To: open->closed

The correct way of linking C++ programs is to use c++(1) 
which adds -lstdc++ automatically.  This has been fixed 
in FreeBSD 4.6-STABLE, in bsd.prog.mk,v 1.86.2.14 by 
providing a new PROG_CXX knob as an alternative to PROG. 
bsd.README has been updated accordingly.