Build on Mac OSX Yosemite 10.10 with Xcode only Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
captwiggum
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jun 24, 2015 10:54 pm

Build on Mac OSX Yosemite 10.10 with Xcode only

Post by captwiggum » Wed Jun 24, 2015 11:08 pm

Has anyone built wxWidgets on Mac OSX Yosemite with Xcode only? (i.e. no mac ports)

In the past I have successfully built and used wxWidgets 2.8.x on older versions of OSX with Xcode and Mac Ports tools.

But I am having trouble building on Mac OSX 10.10.3 Yosemite.
In this case I am using only Xcode 6.3.2 with no mac ports.
I have tried building wxWidgets 3.0.2 64-bit Cocoa, and wxMac 2.8.12 32-bit Carbon.
I am following the instructions exactly, and both builds break with source code errors.

I hesitate to post all the build fail details, hoping there is a patch or FAQ for Yosemite that I missed.
But if not, then of course I can post all the details. Thank you for any tips.
Last edited by captwiggum on Thu Jun 25, 2015 8:05 pm, edited 1 time in total.

User avatar
tierra
Site Admin
Site Admin
Posts: 1342
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: Build on Mac OSX Yosemite 10.10 with Xcode only

Post by tierra » Wed Jun 24, 2015 11:40 pm

Are you building the library using the Xcode project files, or using the command line configure/make? If the latter, what are the configure options you're using? What are the first few errors?

User avatar
captwiggum
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jun 24, 2015 10:54 pm

Re: Build on Mac OSX Yosemite 10.10 with Xcode only

Post by captwiggum » Thu Jun 25, 2015 12:09 am

Thank you so much for the reply.

I have now successfully compiled 3.0.2 by using
--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/

But still no joy trying to compile wxMac-2.8.12. I need the 2.8 for TrueCrypt. That is the kind of thing I do not want to experiment with 3.0.2, lest I put some disk files at risk if a compatibility bump arises at run time. This is my config:


../configure CFLAGS="-arch i386" CXXFLAGS="-arch i386" CPPFLAGS="-arch i386" LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386" --enable-unicode --disable-debug --disable-shared --with-carbon --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk --with-macosx-version-min=10.9


and the build error it hits is:


/Users/jmasinter/src/wxMac-2.8.12/build-carbon-2/bk-deps g++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -c -o baselib_dynlib.o -I./.pch/wxprec_baselib -D__WXMAC__ -DWXBUILDING -I../src/tiff -I../src/jpeg -I../src/png -I../src/regex -DwxUSE_GUI=0 -DwxUSE_BASE=1 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I/Users/jmasinter/src/wxMac-2.8.12/build-carbon-2/lib/wx/include/mac-unicode-release-static-2.8 -I../include -fpascal-strings -I../src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon -arch i386 -DWX_PRECOMP -Wall -Wundef -Wno-ctor-dtor-privacy -O2 -fno-strict-aliasing -arch i386 -fno-common ../src/common/dynlib.cpp
In file included from ../src/common/dynlib.cpp:48:
In file included from ../include/wx/mac/private.h:4:
../include/wx/mac/carbon/private.h:1459:9: error: unknown type name 'Cursor'; did you mean 'NSCursor'?
typedef Cursor ClassicCursor;
^~~~~~
NSCursor
../include/wx/defs.h:2508:28: note: 'NSCursor' declared here
DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
^
../include/wx/defs.h:2486:16: note: expanded from macro 'DECLARE_WXCOCOA_OBJC_CLASS'
typedef struct klass *WX_##klass
^
1 error generated.
make: *** [baselib_dynlib.o] Error 1


In an older post from you, you said that 2.8.x is just not compatible with OSX 10.10, or for that matter 10.9.
Unfortunately the OSX 10.10 Xcode only provides the 10.9 SDK for backward compatibility.
I don't know if there is a way to add older SDKs to Xcode.

User avatar
captwiggum
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jun 24, 2015 10:54 pm

Re: Build on Mac OSX Yosemite 10.10 with Xcode only

Post by captwiggum » Thu Jun 25, 2015 12:14 am

Sorry I did not answer your main question. I am using command line configure/make. Long live GNU command line tools! :D

User avatar
captwiggum
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jun 24, 2015 10:54 pm

[SOLVED] Re: Build on Mac OSX Yosemite 10.10 with Xcode only

Post by captwiggum » Thu Jun 25, 2015 8:05 pm

SOLVED: ...sort of...

With further experimentation, I have still been unable to build wxWidgets 2.8.12 under Mac OSX Yosemite 10.10.3.
As I mentioned, wxWidgets 2.8 is the version required by TrueCrypt. With something so sensitive as disk encryption,
I did not want to stray from the required version. If TrueCrypt has a little hic-up, you could loose your whole disk.

But with no other choice, I built wxWidgets 3.0.2 and linked that with TrueCrypt.
There were no build errors, and no run time errors reported.
So far I have only tested in R/O mode.
But on first review, it appears to work fine.
Note I did not build the TrueCrypt GUI: make NOGUI=1 WXSTATIC=1 NOASM=1
But it still uses many library routines from wxWidgets.

I look forward to any input from others that have done the same with TrueCrypt.

User avatar
tierra
Site Admin
Site Admin
Posts: 1342
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: [SOLVED] Build on Mac OSX Yosemite 10.10 with Xcode only

Post by tierra » Fri Jun 26, 2015 3:37 am

It sounds like TrueCrypt has been updated to work with 3.0 then, but you'd have to confirm that with them, not here.

wxWidgets 2.8 is only compatible with the 10.6 SDK at the latest. You can install older SDKs, but you'll only find them bundled with older versions of Xcode (in this case, 4.1).

User avatar
captwiggum
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jun 24, 2015 10:54 pm

Re: Build on Mac OSX Yosemite 10.10 with Xcode only

Post by captwiggum » Fri Jun 26, 2015 4:15 pm

Thank you for the tip about older SDKs. That will come in handy in the future.

Since I am building TrueCrypt without the GUI, it only uses the wxWidgets helper functions.
So I think that is why it worked without any API complaints.

Thank you for all the help, and for this great Forum resource!

Post Reply