سؤال

I am trying out some cross platform GUI environments and have am evaluating wxWidgets using codelite, but have gotten stuck at the very beginning.

I am very new at this, if its a stupid question please say so.

prerequisites are,

  1. Using OSX Mountain Lion
  2. Installed wxmac via home brew
  3. Downloaded Codelite, created a wxWidgets Executable

I make a GUI project and try to install but get a bunch of missing header errors.

make[1]: wx-config: Command not found
g++  -c  "xxxx/helloworld/main.cpp" -g -O0 -Wall   -o ./Debug/main.o -I. -I. 
g++  -c  "xxxx/helloworld/MainFrame.cpp" -g -O0 -Wall   -o ./Debug/MainFrame.o -I. -I. 
In file included from xxxx/helloworld/MainFrame.h:3,
                 from xxxx/helloworld/MainFrame.cpp:1:
xxxx/helloworld/wxcrafter.h:4:25: error: wx/settings.h: No such file or directory
xxxx/helloworld/wxcrafter.h:5:27: xxxx/helloworld/main.cpp:1:20: error: wx/app.h: No such file or directory
xxxx/helloworld/main.cpp:2:22: error: wx/event.h: No such file or directory
In file included from xxxx/helloworld/MainFrame.h:3,
                 from xxxx/helloworld/main.cpp:3:
xxxx/helloworld/wxcrafter.h:4:25: error: wx/settings.h: No such file or directory
xxxx/helloworld/wxcrafter.h:5:27: error: wx/xrc/xmlres.h: No such file or directory
xxxx/helloworld/wxcrafter.h:6:27: error: wx/xrc/xh_bmp.h: No such file or directory
xxxx/helloworld/wxcrafter.h:7:22: error: wx/frame.h: No such file or directory
xxxx/helloworld/wxcrafter.h:8:22: error: wx/sizer.h: No such file or directory
xxxx/helloworld/wxcrafter.h:9:22: error: wx/panel.h: No such file or directory
xxxx/helloworld/wxcrafter.h:10:21: error: wx/menu.h: No such file or directory
xxxx/helloworld/wxcrafter.h:11:24: error: wx/toolbar.h: No such file or directory
xxxx/helloworld/main.cpp:4:22: error: wx/image.h: No such file or directory
In file included from xxxx/helloworld/MainFrame.h:3,
                 from xxxx/helloworld/main.cpp:3:
xxxx/helloworld/wxcrafter.h:14: error: expected class-name before '{' token
xxxx/helloworld/wxcrafter.h:16: error: ISO C++ forbids declaration of 'wxPanel' with no type
xxxx/helloworld/wxcrafter.h:16: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:17: error: ISO C++ forbids declaration of 'wxMenuBar' with no type
xxxx/helloworld/wxcrafter.h:17: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:18: error: ISO C++ forbids declaration of 'wxMenu' with no type
xxxx/helloworld/wxcrafter.h:18: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:19: error: ISO C++ forbids declaration of 'wxMenuItem' with no type
xxxx/helloworld/wxcrafter.h:19: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:20: error: ISO C++ forbids declaration of 'wxMenu' with no type
xxxx/helloworld/wxcrafter.h:20: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:21: error: ISO C++ forbids declaration of 'wxMenuItem' with no type
xxxx/helloworld/wxcrafter.h:21: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:22: error: ISO C++ forbids declaration of 'wxToolBar' with no type
xxxx/helloworld/wxcrafter.h:22: error: expected ';' before '*' token
xxxx/helloworld/wxcrafter.h:25: error: 'wxCommandEvent' has not been declared
xxxx/helloworld/wxcrafter.h:26: error: 'wxCommandEvent' has not been declared
xxxx/helloworld/wxcrafter.h:29: error: expected `)' before '*' token
xxxx/helloworld/wxcrafter.h: In member function 'virtual void MainFrameBaseClass::OnExit(int&)':
xxxx/helloworld/wxcrafter.h:25: error: request for member 'Skip' in 'event', which is of non-class type 'int'
xxxx/helloworld/wxcrafter.h: In member function 'virtual void MainFrameBaseClass::OnAbout(int&)':
xxxx/helloworld/wxcrafter.h:26: error: request for member 'Skip' in 'event', which is of non-class type 'int'

my guess would be to specify the folder that includes all of these, but am not sure where to find them.

Well to be honest I'm not sure if thats the right action at all, maybe I need to install or set something up, perhaps I shouldn't use homebrew and install by source

Added

Thanks to VZ. I got it working, had to change some of the build settings, as bellow

  1. Settings>BuildSettings>gnu g++>Tools>PATH Environment Variables set to

/usr/local/bin:/usr/bin:/bin

  1. Set all the Compiler, Linker, Shared Object Linker settings to absolute path, so change

g++

to

/usr/bin/g++

and so forth.

This surely changes per setup of the machine so it probably shouldn't be followed to the letter, but should get you started.

hope this helps.

هل كانت مفيدة؟

المحلول

The error you need to fix is the very first one:

make[1]: wx-config: Command not found

Make sure wx-config is in your path. Do not specify the include paths manually, this is not the right way to do it, you must use wx-config.

نصائح أخرى

You probably would need to download wxWidgets source code distribution (2.9.4 from this page or latest source code from SVN), unpack it, build libs from the source code

./configure && make && sudo make install

then reboot and after that try to build the Codellite.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top