Problem with linking with --whole-program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

My program won't link when I add the '--whole-program' option with gcc
4.4.6. It compiles fine with 'g++ -o prog prog.cc test1.cc', but reports
prog.cc:3: undefined reference to `A::A()'
prog.cc:3: undefined reference to `A::~A()'
with 'g++ --whole-program -g -o prog prog.cc test1.cc'

Is this a c++ issue or something with gcc?

BR,
Henrik Mannerström


test1.h:
#ifndef test1_h
#define test1_h

class A {
 public:
  A();
  ~A();
};

extern A a;

#endif /* test1_h */

test1.cc:
#include "test1.h"

A::A() {}

A::~A() {}

prog.cc:
#include "test1.h"

A a;

int main() {
}



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux