3

I am getting lots of undefined reference to `operator delete(void*, unsigned long)' linking error's while building our c++ code with the gcc 8.2 on RHEL7, earlier we ware building with the gcc 4.8 and it was building fine.

 ~Destructor()
    {
        delete PointerToDynamicallyAllacatedAnotherClassObject;
    }

Linker Error: undefined reference to `operator delete(void*, unsigned long)'

mmm
  • 85
  • 1
  • 8
  • 2
    Create a [mcve] – eerorika Jun 19 '19 at 12:09
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – L. F. Jun 19 '19 at 12:13
  • 1
    This symbol is defined in libstdc++.so. Do you compile with g++? – Oliv Jun 19 '19 at 12:15
  • 1
    Yes, I am compiling with g++, I have tried linking libstdc++ but it is not working. – mmm Jun 19 '19 at 12:30
  • [this](https://en.cppreference.com/w/cpp/memory/new/operator_delete)? (see cases 5 and 6) – C.M. Jun 19 '19 at 14:05

0 Answers0