简体   繁体   English

在Mac OSX 10.10上编译WxWidgets

[英]Compiling WxWidgets on Mac OSX 10.10

I'm trying to compile WxWidgets 3.0.2 on my mac OSX 10.10 and I get the following message: 我正在尝试在Mac OSX 10.10上编译WxWidgets 3.0.2,并且收到以下消息:

Blockquote ... 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/.../wxWidgets-3.0.2/build_rel/lib/libwx_osx_cocoau-3.0.0.2.0.dylib] Error 1 Blockquote ... ld:对于体系结构x86_64 clang找不到符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)make:*** [/Users/.../wxWidgets-3.0 .2 / build_rel / lib / libwx_osx_cocoau-3.0.0.2.0.dylib]错误1

I'm compiling using these flags 我正在使用这些标志进行编译

../configure --with-osx_cocoa --with-macosx-version-min=10.7 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk --prefix="$(pwd)" --with-opengl CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++ --enable-universal-binary=x86_64 --enable-monolithic --enable-unicode --with-expat=builtin --with-zlib=builtin --with-libtiff=builtin --with-regex=builtin --with-libpng=builtin --with-libjpeg=builtin ../configure --with-osx_cocoa --with-macosx-version-min = 10.7 --with-macosx-sdk = / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10 .10.sdk --prefix =“ $(pwd)” --with-opengl CC = clang CXX = clang ++ CXXFLAGS =“-stdlib = libc ++ -std = c ++ 11” OBJCXXFLAGS =“-stdlib = libc ++ -std = c ++ 11“ LDFLAGS = -stdlib = libc ++ --enable-universal-binary = x86_64 --enable-monolithic --enable-unicode --with-expat = builtin --with-zlib = builtin --with-libtiff =内建--with-regex =内建--with-libpng =内建--with-libjpeg =内建

As you can see I added the enable-universal-binary=x86_64 as suggested in other topics. 如您所见,我按照其他主题的建议添加了enable-universal-binary = x86_64。

If you can suggest other flags that I might have not added or I should remove that would be great.. Thanks 如果您可以建议我可能未添加的其他标志,或者应该删除它,那将是很好的。.谢谢

The other way: 另一种方法:

brew install wxwidgets

you will get compiled wxWidgets in /usr/local/Cellar . 您将在/usr/local/Cellar获得编译的wxWidgets。

In principle, this should work, but what is the point of using --enable-universal-binary=x86_64 ? 原则上,这应该可行,但是使用--enable-universal-binary=x86_64什么意义? It's not universal if there is only a single architecture... You probably wanted to use --enable-macosx_arch=x86_64 instead. 如果只有一个体系结构,这不是通用的……您可能想使用--enable-macosx_arch=x86_64

BTW, I think the various stdlib-related options are unnecessary as well, clang is the default compiler under 10.10. 顺便说一句,我认为各种与stdlib相关的选项也是不必要的,clang是10.10下的默认编译器。 And --enable-unicode is definitely superfluous. --enable-unicode绝对是多余的。

If you need wx3.0.0 osx 10.7+ monolitic, shared library can get it from here wxphp stub bundle 如果您需要wx3.0.0 osx 10.7+ monolitic,则共享库可从此处获取它wxphp存根包

Library is included in app/contents/resources , use it if you want. 库包含在app / contents / resources中,请根据需要使用。 but you need headers c++, get it from wx side. 但是您需要头文件c ++,从wx端获取它。

As posted here , you can use --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ as a workaround. 如此处所述 ,您可以使用--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/作为解决方法。 There is an fixed issue about it and will probably be released on 3.0.3. 有一个固定的问题 ,可能会在3.0.3上发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM