【问题标题】:Alien::wxWidgets install fails on OSX10.10在 OSX10.10 上 Alien::wxWidgets 安装失败
【发布时间】:2015-12-17 19:48:45
【问题描述】:

我正在尝试安装 Alien::wxWidgets 版本 0.67 和 wxWidgets 版本 3.0.2,但无论我做什么,我都会收到以下错误:

checking if C compiler (clang -mmacosx-version-min=10.5) works with SDK/version options... configure: error: in `/Users/David/.cpan/build/Alien-wxWidgets-0.67-GGkXTu/wxWidgets-3.0.2/bld':
configure: error: no.  Try a different SDK
See `config.log' for more details
system: echo exit | sh ../configure --prefix=/Users/David/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/Alien/wxWidgets/osx_cocoa_3_0_2_uni --with-osx_cocoa --with-opengl --disable-compat24 --enable-unicode  --disable-monolithic --disable-universal_binary  --enable-graphics_ctx CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++: 256 at Build line 60.

我尝试使用标志构建 --with-macosx-sdk=10.5、--with-macosx-sdk=10.10、--without-macosx-sdk、--with-macosx-sdk=/Applications/Xcode .app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ 但它们都不起作用。

这是 config.log 的一部分,我看到了错误,但我不知道如何解决它:

configure:16429: checking for gcc
configure:16456: result: clang
configure:16685: checking for C compiler version
configure:16694: clang --version >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
configure:16705: $? = 0
configure:16694: clang -v >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
configure:16705: $? = 0
configure:16694: clang -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:16705: $? = 1
configure:16694: clang -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:16705: $? = 1
configure:16725: checking whether the C compiler works
configure:16747: clang   -stdlib=libc++ conftest.c  >&5
configure:16751: $? = 0
configure:16799: result: yes
configure:16802: checking for C compiler default output file name
configure:16804: result: a.out
configure:16810: checking for suffix of executables
configure:16817: clang -o conftest   -stdlib=libc++ conftest.c  >&5
configure:16821: $? = 0
configure:16843: result: 
configure:16865: checking whether we are cross compiling
configure:16873: clang -o conftest   -stdlib=libc++ conftest.c  >&5
configure:16877: $? = 0
configure:16884: ./conftest
configure:16888: $? = 0
configure:16903: result: no
configure:16908: checking for suffix of object files
configure:16930: clang -c   conftest.c >&5
configure:16934: $? = 0
configure:16955: result: o
configure:16959: checking whether we are using the GNU C compiler
configure:16978: clang -c   conftest.c >&5
configure:16978: $? = 0
configure:16987: result: yes
configure:16996: checking whether clang accepts -g
configure:17016: clang -c -g  conftest.c >&5
configure:17016: $? = 0
configure:17057: result: yes
configure:17074: checking for clang option to accept ISO C89
configure:17137: clang  -c   conftest.c >&5
configure:17137: $? = 0
configure:17150: result: none needed
configure:17183: checking whether we are using the Intel C compiler
configure:17203: clang -c   conftest.c >&5
conftest.c:18:17: error: use of undeclared identifier 'choke'
                choke me
                ^
1 error generated.
configure:17203: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "wxWidgets"
| #define PACKAGE_TARNAME "wxwidgets"
| #define PACKAGE_VERSION "3.0.2"
| #define PACKAGE_STRING "wxWidgets 3.0.2"
| #define PACKAGE_BUGREPORT "wx-dev@lists.wxwidgets.org"
| #define PACKAGE_URL ""
| #define __BSD__ 1
| #define __DARWIN__ 1
| #define TARGET_CARBON 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|              #ifndef __INTEL_COMPILER
|                 choke me
|              #endif
| 
|   ;
|   return 0;
| }
configure:17213: result: no
configure:17936: checking how to run the C preprocessor
configure:17967: clang -E  conftest.c
configure:17967: $? = 0
configure:17981: clang -E  conftest.c
conftest.c:12:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^
1 error generated.
configure:17981: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "wxWidgets"
| #define PACKAGE_TARNAME "wxwidgets"
| #define PACKAGE_VERSION "3.0.2"
| #define PACKAGE_STRING "wxWidgets 3.0.2"
| #define PACKAGE_BUGREPORT "wx-dev@lists.wxwidgets.org"
| #define PACKAGE_URL ""
| #define __BSD__ 1
| #define __DARWIN__ 1
| #define TARGET_CARBON 1
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>

如果您知道如何解决此问题并让 wxWidgets 在 OSX 10.10 上运行,我将不胜感激。

【问题讨论】:

    标签: macos perl wxwidgets osx-yosemite wxperl


    【解决方案1】:

    添加以下内容:

    --with-macosx-version-min=10.11

    【讨论】:

    • 我在使用sudo cpanm Wx 安装 Wx 时遇到同样的错误。我到底要在哪里添加这个?
    【解决方案2】:

    这不是config.log的正确部分,这个错误是正常/预期的,你应该看看下面的真实的。没有看到它,很难确定,但我认为-mmacosx-version-min=10.5 是罪魁祸首,您的 SDK 可能太新而无法支持 10.5。如果您安装了较旧的 SDK,请尝试选择不同的 SDK(查看 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs 以检查)或查找此 10.5 的来源并将其替换为 10.10 SDK 支持的 10.7(不确定 10.11)。

    【讨论】:

    • 我已将完整的 config.log 上传到 pastebin,因为我真的不知道要在其中查找什么:config.log 我只安装了 10.11,所以我无法选择另一个一个手动的。
    • 这证实了我写的,看862行。你需要使用10.7作为这个SDK的最小版本,而不是10.5。不幸的是,我无法进一步帮助您,因为我不知道这个“10.5”的确切来源,但您应该能够在 Alien::wxWidgets 源中找到它。
    【解决方案3】:

    这就是我大部分在 Mac OS 10.11.4 下构建的方式:

    1. https://metacpan.org/pod/Alien::wxWidgets 下载 Alien::wxWidgets
    2. tar xzf Alien-wxWidgets-0.67.tar.gz
    3. cd Alien-wxWidgets
    4. perl ./Build.PL --wxWidgets-extraflags="--with-macosx-versin-min=10.11"
    5. ./Build

    编译几分钟后,以下错误停止了构建过程:

    ../src/osx/webview_webkit.mm:936:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
        WebBackForwardList* history = [m_webView backForwardList];
                            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/osx/webview_webkit.mm:954:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
        WebBackForwardList* history = [m_webView backForwardList];
                            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    15 warnings and 2 errors generated.
    make: *** [webviewdll_osx_webview_webkit.o] Error 1
    system: make all: 512 at ./Build line 60.
    

    所以--with-macosx-versin-min=10.11 让我们更深入地进入构建过程,但还没有(还)成功构建。 :-(

    【讨论】:

      【解决方案4】:

      我使用了上面@Cal 中的步骤,但使用 wxWidgets 项目中的补丁来修复 m_webView 类型不匹配错误。 wxWidgets 问题在此处跟踪:http://trac.wxwidgets.org/ticket/16329,补丁在此处:http://trac.wxwidgets.org/attachment/ticket/16329/0001-using-proper-types-for-webkit-variants-see-16329.patch,它为您提供补丁的 html 视图。下载链接在这里:http://trac.wxwidgets.org/raw-attachment/ticket/16329/0001-using-proper-types-for-webkit-variants-see-16329.patch

      看起来他们已经在 >= 3.1 版本的主干中修复了这个问题,这是可能的 3.0.3 的建议补丁,但由于 18 个月没有采取任何行动,也许他们会跳过它,这将在下一个版本中消失。

      我在此处重新打包了补丁以使用 Alien::wxWidgets Build.PL:http://markwal.github.io/patches/Alien-wxWidgets-0.67-El-Capitan.patch

      回顾一下我在 Mac OS X El Capitan 10.11.6 下构建的步骤:

      1. https://metacpan.org/pod/Alien::wxWidgets 下载 Alien::wxWidgets
      2. tar xvf Alien-wxWidgets-0.67.tar.gz
      3. http://markwal.github.io/patches/Alien-wxWidgets-0.67-El-Capitan.patch下载补丁
      4. cd Alien-wxWidgets-0.67
      5. 补丁-p1
      6. perl ./Build.PL --wxWidgets-extraflags="--with-macosx-version-min=10.11"
      7. perl 构建
      8. perl 构建测试
      9. perl 构建安装

      【讨论】:

        猜你喜欢
        • 2016-07-23
        • 2015-04-19
        • 1970-01-01
        • 1970-01-01
        • 2018-02-14
        • 2020-07-07
        • 2021-04-24
        • 2020-09-16
        • 2013-05-07
        相关资源
        最近更新 更多