[Bug 924502] [NEW] gcc is broken with -lstdc++ while g++ is OK

Wenjie wenjie_ding at yahoo.com
Tue Jan 31 20:34:40 UTC 2012


Public bug reported:

/*
 * simple.cc
 */
int main() {
    char* buf = new char[64];
    return 0;
}

/*
While compile it with g++, it works OK.
BUT when do the following:

$ gcc -L/usr/lib/x86_64-linux-gnu -lstdc++ simple.cc

simple.cc:(.text+0xe): undefined reference to `operator new[](unsigned long)'
collect2: ld returned 1 exit status

$ cd /usr/lib/x86_64-linux-gnu && ls -l libstd*
lrwxrwxrwx 1 root root     14 2012-01-31 10:33 libstdc++.so -> libstdc++.so.6
lrwxrwxrwx 1 root root     19 2011-11-30 18:44 libstdc++.so.6 -> libstdc++.so.6.0.16
-rw-r--r-- 1 root root 991424 2011-09-16 07:29 libstdc++.so.6.0.16.0.16

Thanks.
*/

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gcc 4:4.6.1-2ubuntu5
ProcVersionSignature: Ubuntu 3.0.0-15.26-generic 3.0.13
Uname: Linux 3.0.0-15-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 62190ceea7acc7fea6bd96f44736370d
CheckboxSystem: 4ed15c40009aa6f7770f606350a390a2
Date: Tue Jan 31 12:23:08 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/usr/local/bin/bash
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-defaults (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug oneiric running-unity

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/924502

Title:
  gcc is broken with -lstdc++ while g++ is OK

Status in “gcc-defaults” package in Ubuntu:
  New

Bug description:
  /*
   * simple.cc
   */
  int main() {
      char* buf = new char[64];
      return 0;
  }

  /*
  While compile it with g++, it works OK.
  BUT when do the following:

  $ gcc -L/usr/lib/x86_64-linux-gnu -lstdc++ simple.cc

  simple.cc:(.text+0xe): undefined reference to `operator new[](unsigned long)'
  collect2: ld returned 1 exit status

  $ cd /usr/lib/x86_64-linux-gnu && ls -l libstd*
  lrwxrwxrwx 1 root root     14 2012-01-31 10:33 libstdc++.so -> libstdc++.so.6
  lrwxrwxrwx 1 root root     19 2011-11-30 18:44 libstdc++.so.6 -> libstdc++.so.6.0.16
  -rw-r--r-- 1 root root 991424 2011-09-16 07:29 libstdc++.so.6.0.16.0.16

  Thanks.
  */

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: gcc 4:4.6.1-2ubuntu5
  ProcVersionSignature: Ubuntu 3.0.0-15.26-generic 3.0.13
  Uname: Linux 3.0.0-15-generic x86_64
  ApportVersion: 1.23-0ubuntu4
  Architecture: amd64
  CheckboxSubmission: 62190ceea7acc7fea6bd96f44736370d
  CheckboxSystem: 4ed15c40009aa6f7770f606350a390a2
  Date: Tue Jan 31 12:23:08 2012
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/usr/local/bin/bash
  SourcePackage: gcc-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/924502/+subscriptions




More information about the foundations-bugs mailing list