Hey everyone,
I posted this question on the wxWidgets Forum, and they told me to come here, so here I am.
It seems like others have been able to successfully build wxWidgets for both Intel and Apple Silicon Macs by adding the--enable-universal_binary=x86_64,arm64
I'm doing it with --enable-macosx_arch=x86_64,arm64
Dave
Undefined symbols for architecture x86_64:
"_crc32", referenced from:
wxZipInputStream::OpenDecompressor(bool) in basedll_zipstrm.o
wxZipInputStream::OnSysRead(void*, unsigned long) in basedll_zipstrm.o
wxZipOutputStream::DoCreate(wxZipEntry*, bool) in basedll_zipstrm.o
wxZipOutputStream::CreatePendingEntry() in basedll_zipstrm.o
wxZipOutputStream::OnSysWrite(void const*, unsigned long) in basedll_zipstrm.o
"_deflate", referenced from:
wxZlibOutputStream::DoFlush(bool) in basedll_zstream.o
wxZlibOutputStream::OnSysWrite(void const*, unsigned long) in basedll_zstream.o
"_deflateEnd", referenced from:
wxZlibOutputStream::Close() in basedll_zstream.o
wxZlibOutputStream::~wxZlibOutputStream() in basedll_zstream.o
"_deflateInit2_", referenced from:
wxZlibOutputStream::Init(int, int) in basedll_zstream.o
"_deflateReset", referenced from:
wxZlibOutputStream2::Open(wxOutputStream&) in basedll_zipstrm.o
"_deflateSetDictionary", referenced from:
wxZlibOutputStream::SetDictionary(char const*, unsigned long) in basedll_zstream.o
wxZlibOutputStream::SetDictionary(wxMemoryBuffer const&) in basedll_zstream.o
"_inflate", referenced from:
wxZlibInputStream::OnSysRead(void*, unsigned long) in basedll_zstream.o
"_inflateEnd", referenced from:
wxZlibInputStream::~wxZlibInputStream() in basedll_zstream.o
wxZlibInputStream::~wxZlibInputStream() in basedll_zstream.o
wxZlibInputStream::~wxZlibInputStream() in basedll_zstream.o
"_inflateInit2_", referenced from:
wxZlibInputStream::Init(int) in basedll_zstream.o
"_inflateReset", referenced from:
wxZlibInputStream2::Open(wxInputStream&) in basedll_zipstrm.o
"_inflateSetDictionary", referenced from:
wxZlibInputStream::SetDictionary(char const*, unsigned long) in basedll_zstream.o
wxZlibInputStream::SetDictionary(wxMemoryBuffer const&) in basedll_zstream.o
"_zlibVersion", referenced from:
wxGetZlibVersionInfo() in basedll_zstream.o
wxGzipClassFactory::wxGzipClassFactory() in basedll_zstream.o
wxZlibInputStream::CanHandleGZip() in basedll_zstream.o
wxZlibInputStream::Init(int) in basedll_zstream.o
wxZlibOutputStream::Init(int, int) in basedll_zstream.o
wxZlibOutputStream::CanHandleGZip() in basedll_zstream.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/camera/Downloads/wx_from_git/wxWidgets/buildOSX/lib/libwx_baseu-3.3.0.0.0.dylib] Error 1
VZ> to the best of my knowledge, allowed even in most polite company.
Haha! Good to know. I think I'd rather use the .dylibs because XCode threw a bunch of 'undefined symbol' errors when I tried to link the static libraries, and I would prefer to not troubleshoot XCode linker errors.
VZ> It looks like zlib is not being linked but I don't know why. You need to
VZ> go back and give us:
VZ>
VZ> 1. Your full configure command line.
VZ> 2. The result of configure check for zlib (summary at the end).
VZ> 3. Full link command which fails.
1. ../configure --disable-sys-libs --enable-macosx_arch=x86_64,arm64
2. Which libraries should wxWidgets use? zlib builtin
3. g++ -std=gnu++11 -mmacosx-version-min=12.0 -dynamiclib -single_module -headerpad_max_install_names -o /Users/camera/Downloads/wx_from_git/wxWidgets/buildOSX/lib/libwx_baseu-3.3.0.0.0.dylib basedll_any.o basedll_appbase.o basedll_arcall.o basedll_arcfind.o basedll_archive.o basedll_arrstr.o basedll_base64.o basedll_clntdata.o basedll_cmdline.o basedll_config.o basedll_convauto.o basedll_datetime.o basedll_datetimefmt.o basedll_datstrm.o basedll_dircmn.o basedll_dynlib.o basedll_dynload.o basedll_encconv.o basedll_evtloopcmn.o basedll_extended.o basedll_ffile.o basedll_file.o basedll_fileback.o basedll_fileconf.o basedll_filefn.o basedll_filename.o basedll_filesys.o basedll_filtall.o basedll_filtfind.o basedll_fmapbase.o basedll_fs_arc.o basedll_fs_filter.o basedll_hash.o basedll_hashmap.o basedll_init.o basedll_intl.o basedll_ipcbase.o basedll_languageinfo.o basedll_list.o basedll_log.o basedll_longlong.o basedll_memory.o basedll_mimecmn.o basedll_module.o basedll_mstream.o basedll_numformatter.o basedll_object.o basedll_platinfo.o basedll_powercmn.o basedll_process.o basedll_regex.o basedll_stdpbase.o basedll_sstream.o basedll_stdstream.o basedll_stopwatch.o basedll_strconv.o basedll_stream.o basedll_string.o basedll_stringops.o basedll_strvararg.o basedll_sysopt.o basedll_tarstrm.o basedll_textbuf.o basedll_textfile.o basedll_threadinfo.o basedll_time.o basedll_timercmn.o basedll_timerimpl.o basedll_tokenzr.o basedll_translation.o basedll_txtstrm.o basedll_unichar.o basedll_uri.o basedll_ustring.o basedll_variant.o basedll_wfstream.o basedll_wxcrt.o basedll_wxprintf.o basedll_xlocale.o basedll_xti.o basedll_xtistrm.o basedll_zipstrm.o basedll_zstream.o basedll_fswatchercmn.o basedll_fswatcherg.o basedll_common_secretstore.o basedll_lzmastream.o basedll_common_uilocale.o basedll_core_mimetype.o basedll_cfstring.o basedll_evtloop_cf.o basedll_strconv_cf.o basedll_utils_base.o basedll_core_secretstore.o basedll_core_uilocale.o basedll_fdiodispatcher.o basedll_selectdispatcher.o basedll_appunix.o basedll_unix_dir.o basedll_dlunix.o basedll_epolldispatcher.o basedll_evtloopunix.o basedll_fdiounix.o basedll_unix_snglinst.o basedll_unix_stackwalk.o basedll_timerunx.o basedll_threadpsx.o basedll_utilsunx.o basedll_wakeuppipe.o basedll_fswatcher_kqueue.o basedll_fswatcher_fsevents.o basedll_cocoa_stdpaths.o basedll_event.o basedll_fs_mem.o basedll_msgout.o basedll_utilscmn.o basedll_cocoa_power.o basedll_cocoa_utils.o basedll_osx_volume.o -L/Users/camera/Downloads/wx_from_git/wxWidgets/buildOSX/lib -install_name /usr/local/lib/libwx_baseu-3.3.0.dylib -compatibility_version 1.0 -current_version 1.0 -arch x86_64 -arch arm64 -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -lwxzlib-3.3 -lwxregexu-3.3 -lwxexpat-3.3 -arch x86_64 -arch arm64 -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -framework Security -lpthread -liconv -lcurl -framework Security -lpthread -liconv -lcurl
It looks like it's including the zlib library. However, I also noticed this line in the configure output: libdeflate support: no
^ could this be the issue? I tried '--enable-libdeflate' but that wasn't recognized. Is there a flag that would remedy it?
cmd LC_ID_DYLIB
cmdsize 112
name /Users/camera/Downloads/wx_from_git/wxWidgets/buildOSX/lib/libwx_baseu-3.3.0.0.0.dylib (offset 24)
time stamp 1 Wed Dec 31 16:00:01 1969
They're all like that. I originally built the libraries in that location, but obviously I don't want the path hardcoded there. I tried changing it manually with install_name_tool but it told me I would be invalidating the code signature by doing so.
Is this something I can fix when building wxWidgets?