wxWidgets 2.8.9, local install, compiled using --enable-unicode --disable-shared, had to copy lib/wx/config/mac-unicode-release-static-2.8 to /usr/local/lib/wx/config in order for wx-config to find it.
If I try building the Active Target Configure in Xcode, I get:
If I do, I get:
xcodebuild -target Audacity -configuration “Release Static”
** BUILD FAILED **
The following build commands failed:
Configure:
PhaseScriptExecution “/Users/grav/repositories/audacity/mac/build/Audacity.build/Release Static/Configure.build/Script-17072E8C0988BD85008541CC.sh”
libsndfile:
CompileC “build/Audacity.build/Release Static/libsndfile.build/Objects-normal/ppc/sndfile.o” /Users/grav/repositories/audacity/mac/…/lib-src/libsndfile/src/sndfile.c normal ppc c com.apple.compilers.gcc.4_0
Audacity:
Preprocessing “/Users/grav/repositories/audacity/mac/build/Audacity.build/Release Static/Audacity.build/Preprocessed-Info.plist” Info.plist
ProcessPCH++ /var/folders/cM/cMyd95CnFh8Z0+nKIvSIr++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AudacityHeaders-ezlkvjbsqepcprafmdlhwhypewaq/AudacityHeaders.h.gch …/src/AudacityHeaders.h normal i386 c++ com.apple.compilers.gcc.4_0
ProcessPCH++ /var/folders/cM/cMyd95CnFh8Z0+nKIvSIr++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AudacityHeaders-guntcpppmypexggfrxkvcpznassr/AudacityHeaders.h.gch …/src/AudacityHeaders.h normal ppc c++ com.apple.compilers.gcc.4_0
(5 failures)
I don’t have enough experience building apps on OS X to figure out what’s going wrong from the error’s you’re getting, however, I downloaded and compiled audacity for the first time 2 days ago and got it up and running tonight. From my experience, I have a strong feeling that you’ve configured wxWindows incorrectly. Especially since you’re having to move various items around in your system. That’s never a good thing.
Here’s what I did to get it to work:
MySetup:
OS X: 10.5.6
XCode 3.1.2
I’m not building universal binaries…
Downloaded wxMac 2.8.10
Downloaded audacity 1.3.8 from cvs
wxWindows was configured with the following switches
./configure --disable-shared --enable-static --enable-unicode --disable-dependency-tracking --disable-monolithic --prefix=/Users/bcox/Development/audacity/wx/
Note that I’ve changed the default location for wxWindows. I think it’s best not to install it into /usr/local/.
make
sudo make install
OK, wxWindows should be installed and OK.
Next I fired up the audacity XCode file
Change WX_PREFIX (in the User Defined section) to the location of your wx install. For me that’s /Users/bcox/Development/audacity/wx
I don’t have a libwx_expat.a but I do have a libexpat.a in /usr/local/lib/ so I modified WX_LDFLAGS to point to that instead
I also had to comment out line 1365 of ProcessDialog.cpp because of a problem with wxSound(…). I need to look into it but you could also change it to read:
s.Create((wxChar)beep, sizeof(beep)); That might work. Or it might crash things when your process dialog sends out a beep.
wxWindows was configured with the following switches
./configure --disable-shared --enable-static --enable-unicode --disable-dependency-tracking --disable-monolithic --prefix=/Users/bcox/Development/audacity/wx/
Yep, this took care of a lot of problems - now wx-config seems to look for the config files the right place.
Next I fired up the audacity XCode file
Change WX_PREFIX (in the User Defined section) to the location of your wx install. For me that’s /Users/bcox/Development/audacity/wx
I don’t have a libwx_expat.a but I do have a libexpat.a in /usr/local/lib/ so I modified WX_LDFLAGS to point to that instead
I also had to comment out line 1365 of ProcessDialog.cpp because of a problem with wxSound(…). I need to look into it but you could also change it to read:
s.Create((wxChar)beep, sizeof(beep)); That might work. Or it might crash things when your process dialog sends out a beep.
This expat-thing gave me problems as well. I don’t have a libexpat.a in /usr/local/lib/ either, but I did find one in another project.
However, I still get 89 errors of this sort:
Undefined symbols:
"_mktime$UNIX2003", referenced from:
wxDateTime::SetFromDOS(unsigned long)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
wxDateTime::Set(tm const&) in libwx_base_carbonu-2.8.a(baselib_datetime.o)
wxDateTime::Set(unsigned short, unsigned short, unsigned short, unsigned short)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
wxDateTime::GetWeekDayName(wxDateTime::WeekDay, wxDateTime::NameFlags)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
wxGetLocalTime() in libwx_base_carbonu-2.8.a(baselib_stopwatch.o)
"_XML_GetErrorCode", referenced from:
XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
"_write$UNIX2003", referenced from:
wxFile::Write(void const*, unsigned long)in libwx_base_carbonu-2.8.a(baselib_file.o)
wxSingleInstanceCheckerImpl::CreateLockFile() in libwx_base_carbonu-2.8.a(baselib_unix_snglinst.o)
__tiffWriteProc in libwxtiff-2.8.a(wxtiff_tif_unix.o)
"_select$UNIX2003", referenced from:
wxPipeInputStream::CanRead() const in libwx_base_carbonu-2.8.a(baselib_utilsunx.o)
GSocket::Output_Timeout() in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)
GSocket::Input_Timeout() in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)
GSocket::Select(int) in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)
Hmm, could it be that I’ve built wxWidgets for 10.5 but I am trying to build Audacity for 10.4? I’ve tried compiling Audacity for 10.5 instead, but this gives other errors. So if the problem is indeed that wxWidgets needs to be compiled for 10.4, how do I do that on a 10.5 machine?
Edit: and by the way, thanks for your first assistance, bcox
Edit: also tried using compiler flag -mmacosx-version-min=10.4 (while compiling for 10.4) without any luck.
I got similar linker errors the first time around as well. Under the build settings I changed the “Base SDK” and “Deployment Target” settings to be “Mac OS X 10.5” and the errors went away. I just tested it again with 10.4 as the Base SDK and I get the same errors (although there are only 20 errors).
The change should help with most of those linker errors. If all the standard c linker errors go away (write, mktime, etc.) and you’re still getting XML linker errors, you’ll need to build a copy of the expat library. libwxexpat.a should be able to be built by looking in wxMac-2.8.10/src/expat/. You can build it without building the rest of wxWindows. I think that’s where I got the copy that’s in my /usr/local/lib/ folder from.
I think you’re really close to a successful build. Let me know if you get it working.
Applying the patch in the mac-dir on wxWidgets 2.8.9
cd /path/to/wxMac-2.8.9
# I think this takes care of some wx sound probs
patch -p1 < /path/to/audacityrepos/mac/wxMac-2.8.9.patch
./configure --disable-compat26 --with-expat=builtin --with-zlib=builtin --with-regex=builtin --enable-universal_binary=yes --enable-static=yes --enable-shared=no --enable-unicode=yes --enable-debug=no --prefix=/where/to/install/wxwidgets
make clean
make -j 7
make -j 7 install
Only other thing to do is to change Xcode WX_PREFIX variable to /where/to/install/wxwidgets