Search code examples
c++cmakewxwidgetsclion

wxWidgets include files all in same folder?


I'm on a Xubuntu machine. I've downloaded and compiled the source, did the make install.

I'm trying to create a simple wxFrame class, but when I include <wx-3.0/wx/frame.h>, it says Can't resolve type wxFrame. When I look inside frame.h, it includes a reference to <wx/toplevel.h>. Both frame.h and toplevel.h are in the same folder. Why does the compilation place the include files all in the same folder, but the paths to the files are different?

I am using CLion IDE and the include/lib paths are set by cmake's FIND_PACKAGE().


Solution

  • @ShrimpCrackers,

    It is generally advisable to start you project by copying one of the sample code into you project and then set you project properties to the output of wx-config --cxxflags and wx-config --libs.

    So what you should do is to copy the wxWidgets/samples/minimal/minimal.cpp over to the directory where you project is, fix the project properties and recompile.

    BTW, you don't have to do make install. You might want to compile debug and release versions of the library on one machine which defeats the purpose of installing. You just use the compiled version of the library