wxMac 2.8.12 on OSX 10.9 Mavericks

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
fizix
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Dec 01, 2013 8:49 pm

wxMac 2.8.12 on OSX 10.9 Mavericks

Post by fizix »

I can't compile wxWidgets 2.8 on OSX mavericks.

Code: Select all

../wxMac-2.8.12/configure --enable-debug --enable-unicode --disable-shared
The following error is reported:

Code: Select all

../wxMac-2.8.12/include/wx/mac/carbon/private.h:1459:9: error: unknown type name 'Cursor'; did you mean 'NSCursor'?
typedef Cursor ClassicCursor;
        ^~~~~~
        NSCursor
../wxMac-2.8.12/include/wx/defs.h:2508:28: note: 'NSCursor' declared here
DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
                           ^
../wxMac-2.8.12/include/wx/defs.h:2486:16: note: expanded from macro 'DECLARE_WXCOCOA_OBJC_CLASS'
typedef struct klass *WX_##klass
               ^
I am aware that carbon is not supported any more, but switching to cocoa yields the following error:

Code: Select all

../wxMac-2.8.12/configure --enable-debug --enable-unicode --disable-shared --with-cocoa

Code: Select all

../wxMac-2.8.12/src/cocoa/NSButton.mm:59:68: error: no viable conversion from 'wxNSButtonTarget *' to 'const wxObjcAutoRefFromAlloc<struct
      objc_object *>'
const wxObjcAutoRefFromAlloc<struct objc_object*> wxCocoaNSButton::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSButtonTarget) alloc] init];
                                                                   ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../wxMac-2.8.12/include/wx/cocoa/ObjcRef.h:158:5: note: candidate constructor not viable: no known conversion from 'wxNSButtonTarget *' to
      'objc_object *' for 1st argument
    wxObjcAutoRefFromAlloc(T p = 0)
    ^
../wxMac-2.8.12/include/wx/cocoa/ObjcRef.h:174:5: note: candidate constructor not viable: no known conversion from 'wxNSButtonTarget *' to
      'const wxObjcAutoRefFromAlloc<objc_object *> &' for 1st argument
    wxObjcAutoRefFromAlloc(const wxObjcAutoRefFromAlloc& otherRef)
    ^
Any idea of how to get it compiled?
__note
In need of some credit
In need of some credit
Posts: 1
Joined: Sat Jan 18, 2014 6:07 pm

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by __note »

Hi fizix,

I've got exactly the same problem on OSX mavericks, have you managed workaround this problem?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by doublemax »

wx 2.8 is ancient. Please try again with 3.0
Use the source, Luke!
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

I get the:-

.

Code: Select all

./wxMac-2.8.12/include/wx/mac/carbon/private.h:1459:9: error: unknown type name 'Cursor'; did you mean 'NSCursor'?
typedef Cursor ClassicCursor;
        ^~~~~~
        NSCursor
../wxMac-2.8.12/include/wx/defs.h:2508:28: note: 'NSCursor' declared here
DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
                           ^
../wxMac-2.8.12/include/wx/defs.h:2486:16: note: expanded from macro 'DECLARE_WXCOCOA_OBJC_CLASS'
typedef struct klass *WX_##klass
^
error both when using the recommended "-arch i386" flags and without, unlike the previous post where different errors were manifest. This suggests firstly that clang/LLVM does not suffer from the gcc issue for which the arch flag is mentioned as a fix.

However "wx 2.8 is ancient. Please try again with 3.0" is not an option since I am trying to build wx in order to build wxruby. Currently wxruby does not support 3.x and afaik there are no plans for it to do so, so I need to make 2.8 work....
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

Trying to force compiling against the the Snow leopard SDK

Code: Select all

--with-macosx-sdk="/Volumes/Snow_1/Developer/SDKs/MacOSX10.6.sdk" \
--with-macosx-version-min=10.6
Led to different errors

Code: Select all

/src/mac/carbon/graphics.cpp:1072:74: error: redefinition of parameter 'y'
    virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *y) const;
                                                                         ^
./src/mac/carbon/graphics.cpp:1072:48: note: previous declaration is here
    virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *y) const;
                                               ^
./src/mac/carbon/graphics.cpp:1098:70: error: cannot initialize object parameter of type 'const wxGraphicsObjectRefData' with an
      expression of type 'const wxMacCoreGraphicsPathData'
    wxMacCoreGraphicsPathData* clone = new wxMacCoreGraphicsPathData(GetRenderer(),CGPathCreateMutableCopy(m_path));
                                                                     ^~~~~~~~~~~
./src/mac/carbon/graphics.cpp:1099:12: error: cannot initialize return object of type 'wxGraphicsObjectRefData *' with an lvalue of
      type 'wxMacCoreGraphicsPathData *'
    return clone ;
           ^~~~~
[...]
/src/mac/carbon/graphics.cpp:2220:19: error: cannot initialize a parameter of type 'wxObjectRefData *' with an rvalue of type
      'wxMacCoreGraphicsPathData *'
    m.SetRefData( new wxMacCoreGraphicsPathData(this));
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by eranon »

Audacity (a well known wxWidgets-based software) is using wxWidgets 2.8 and their wiki says it's possible, but only with an OS X 10.9 coming from OSX update. Here is the excerpt, from the top of their page at http://wiki.audacityteam.org/wiki/Building_On_Mac :

Code: Select all

The steps also work on Mavericks updated from earlier OS X but may not work on Mavericks installed as first operating system
Hope it helps...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

eranon wrote:Audacity (a well known wxWidgets-based software) is using wxWidgets 2.8 and their wiki says it's possible, but only with an OS X 10.9 coming from OSX update. Here is the excerpt, from the top of their page at http://wiki.audacityteam.org/wiki/Building_On_Mac :

Code: Select all

The steps also work on Mavericks updated from earlier OS X but may not work on Mavericks installed as first operating system
Hope it helps...
AFAIK the significant difference between an update and new install is that the update will have the old SDK's as well as the latest, but the new only ships with the current SDK's. Its good to know its possible and I see that Audacity uses a custom wxWdigets build script so I will have to delve further and see why simply binding to the old SDK didn't work.

Thanks for the heads up though as it gives me somewhere to look. :D
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

Thanks to the tip from eranon I have made progress, :D successfully managed a build against 10.6 SDK by forcing the use of gcc 4.2.
By default in mavericks/Xcode 5.02 gcc -> clang, but I had a genuine gcc from a previous build so exported its PATH and the make goes all the way!

Now going to see which SDK is the latest that will work....
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

TimN wrote:Thanks to the tip from eranon I have made progress, :D successfully managed a build against 10.6 SDK by forcing the use of gcc 4.2.
By default in mavericks/Xcode 5.02 gcc -> clang, but I had a genuine gcc from a previous build so exported its PATH and the make goes all the way!

Now going to see which SDK is the latest that will work....
So 10.6 is the latest it will build against, so here is my script:-

Code: Select all

#! /bin/bash
ROOTNAME="/Volumes/Ge-SATA-1/tim/wx-OSX"
export MES="${ROOTNAME}/src"
export TARGET="${ROOTNAME}/build"
export CMPL="${TARGET}/compile"
export PATH="${TARGET}/bin:$PATH"

arch_flags="-arch i386"
sdk="/Users/Shared/SDKs/MacOSX10.6.sdk"
export PATH="/Volumes/Snow/Developer/usr/bin:${PATH}"

pushd ${CMPL}/wxMac-2.8.12
make clean
./configure --prefix=${TARGET} --disable-shared --enable-static --enable-unicode \
CFLAGS="$arch_flags" \
CXXFLAGS="$arch_flags" \
CPPFLAGS="$arch_flags" \
LDFLAGS="$arch_flags" \
OBJCFLAGS="$arch_flags" \
OBJCXXFLAGS="$arch_flags" \
--with-macosx-sdk="${sdk}" \
--with-macosx-version-min=10.6

 make -j 2 && make install

popd

exit
Note I had pre-built, using the same environment, package config, yasm, swig, cmake.. and /Volumes/Snow/Developer/usr/bin had gcc 4.2 and friends
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

OK, so currently one little snafu with my above process, wxMedia hasn't built, which I don't need for my current use case.
TimN
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 31, 2014 11:43 am

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by TimN »

TimN wrote:OK, so currently one little snafu with my above process, wxMedia hasn't built, which I don't need for my current use case.
Fixed that with

Code: Select all

--enable-mediactrl
I now also have a full fat version of WxRuby for ruby 2.0 on Mavericks if anyone is interested... :D
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: wxMac 2.8.12 on OSX 10.9 Mavericks

Post by eranon »

Nice to see you succeeded ^o^
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply