Search code examples
c++wxwidgets

wxwidgets // g++ Compiler error: no matching function for call to 'operator new(..'


At the moment I am trying to port a Visual C++ application to Linux. The code compiles without errors in Visual Studio, but I get many compiler errors under Linux. One of these errors is:

../src/wktools4.cpp:29: error: no matching function for
call to 'operator new(unsigned int, const char[40], int)'

More information:

  • IDE: kdevelop with G++
  • GUI API:

The error appears at the following line:

IMPLEMENT_APP(Cwktools4App)

and some other lines.

What am I missing?


Solution

  • I found the error:

    #ifdef __WXDEBUG__
    #define new WXDEBUG_NEW
    #endif
    

    When I remove these lines, I don't get the errors any more. The code was generated from a wxwidgets wizard for VisualStudio. I have no idea what it does...

    Thank you all for your help! Now I have to fix the linker errors ;)