Help setting up wxwidgets on OSX Mavericks

CodeLite installation/troubleshooting forum
Dewdman42
CodeLite Curious
Posts: 6
Joined: Fri Oct 03, 2014 11:17 am
Genuine User: Yes
IDE Question: C++
Contact:

Help setting up wxwidgets on OSX Mavericks

Post by Dewdman42 »

I am unable to compile a simple wxwidgets project using CodeLite 6.1. I get the following error:

Code: Select all

.
.
/usr/bin/g++   -c  "/Users/sjs/Documents/wxprojects/workspaces/myworkspace/tester/MainFrame.cpp" -g -O0 -Wall -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__   -o ./Debug/MainFrame.cpp.o -I. -I.
In file included from /Users/sjs/Documents/wxprojects/workspaces/myworkspace/tester/wxcrafter.cpp:1:
In file included from ./wxcrafter.h:4:
In file included from /usr/local/include/wx-3.0/wx/settings.h:14:
In file included from /usr/local/include/wx-3.0/wx/colour.h:15:
In file included from /usr/local/include/wx-3.0/wx/gdiobj.h:14:
In file included from /usr/local/include/wx-3.0/wx/object.h:19:
In file included from /usr/local/include/wx-3.0/wx/memory.h:15:
In file included from /usr/local/include/wx-3.0/wx/string.h:46:
/usr/local/include/wx-3.0/wx/strvararg.h:30:18: fatal error: 'tr1/type_traits' file not found
        #include <tr1/type_traits>
                 ^
I previously downloaded wxwidgets 3.0.1 src and compiled it using command line on OSX, including sudo make install. The sample wxwidgets apps all launch and look great.

In CodeLite, I added to the workspace settings the following in order to find wx-config:

Code: Select all

PATH=$PATH:/usr/local/bin
So now trying to create first wxwidgets app using CodeLite. I create new project, select wxiwdgets frame type, then try to build, and this error about unable to find type_traits.

Anyone have any ideas how to get first simple wxwidgets app to compile through CodeLite?
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Help setting up wxwidgets on OSX Mavericks

Post by eranif »

This is usually happens when you have a mismatch between the library (wxWidgets) and your code compile flags.
You need to make sure that your application is built with the exact flags as your wxWidgets build.

For example, if you built wxWidgets with the

Code: Select all

 -std=c++11 -stdlib=libc++
flags, you need to set them in codelite as well
Also, use the same 'with-macosx-version-min' flag in

For example:

Code: Select all

--with-macosx-version-min=10.8
All the compilation flags are set in the project settings->common settings->compiler->compiler options

Eran
Make sure you have read the HOW TO POST thread
Dewdman42
CodeLite Curious
Posts: 6
Joined: Fri Oct 03, 2014 11:17 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Help setting up wxwidgets on OSX Mavericks

Post by Dewdman42 »

Thanks a lot! Adding -mmacosx-version-min=10.5 to both the compiler and linker flags enabled it to build. I'm off to the races. Thanks!
EricRFMA
CodeLite Curious
Posts: 4
Joined: Fri Oct 24, 2014 10:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Help setting up wxwidgets on OSX Mavericks

Post by EricRFMA »

Dewdman42 wrote:I am unable to compile a simple wxwidgets project using CodeLite 6.1. I get the following error:

Code: Select all

.
.
.
I previously downloaded wxwidgets 3.0.1 src and compiled it using command line on OSX, including sudo make install. The sample wxwidgets apps all launch and look great.

In CodeLite, I added to the workspace settings the following in order to find wx-config:

Code: Select all

PATH=$PATH:/usr/local/bin
So now trying to create first wxwidgets app using CodeLite. I create new project, select wxiwdgets frame type, then try to build, and this error about unable to find type_traits.

Anyone have any ideas how to get first simple wxwidgets app to compile through CodeLite?
Just wanted to let you know that I was having trouble getting the $PATH right to find wx-config, and your question helped me to figure out where to put it and what the syntax is, since that window ("Workspace Settings") doesn't give any hints about how the environment variables can be specified.

So, thanks! :D

-Eric
Post Reply