【问题标题】:Alien::wxWidgets install fails on OSX 10在 OSX 10 上 Alien::wxWidgets 安装失败
【发布时间】:2016-07-23 02:58:08
【问题描述】:

它与this one 基本相同,但并没有真正结束。

我也遇到了同样的问题,我走得更远了。我不得不更改代码以允许更新的 Macos sdk (10.11)。所以它编译了一段时间,但后来失败了:

❯❯❯ perl build
Building Alien-wxWidgets
/Users/guiohm/.cpan/build/Alien-wxWidgets-0.67-rVjMTK/wxWidgets-3.0.2/bld/bk-deps clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -c -o wxtiff_tif_lzma.o -DNDEBUG  -I../src/jpeg -I/Users/guiohm/.cpan/build/Alien-wxWidgets-0.67-rVjMTK/wxWidgets-3.0.2/bld/src/tiff/libtiff -I../src/tiff/libtiff -dynamic -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -I/Users/guiohm/.cpan/build/Alien-wxWidgets-0.67-rVjMTK/wxWidgets-3.0.2/bld/lib/wx/include/osx_cocoa-unicode-3.0 -I../include -Wall -Wundef -O2 -fno-strict-aliasing -fno-common  ../src/tiff/libtiff/tif_lzma.c
../src/tiff/libtiff/tif_lzma.c:38:10: fatal error: 'lzma.h' file not found
#include "lzma.h"
         ^
1 error generated.
make: *** [wxtiff_tif_lzma.o] Error 1
system: make all: 512 at build line 68.

❯❯❯ brew search
lzma is now part of the xz formula.

❯❯❯ brew info
xz: stable 5.2.2 (bottled)
General-purpose data compression with high compression ratio
http://tukaani.org/xz/
/usr/local/Cellar/xz/5.2.2 (91 files, 1.4M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/xz.rb
==> Options
--universal
    Build a universal binary

❯❯❯ brew install xz
Warning: xz-5.2.2 already installed

❯❯❯ find / -name "lzma.h"
/usr/local/Cellar/xz/5.2.2/include/lzma.h
/usr/local/include/lzma.h

❯❯❯ ll /usr/local/include/lzm*
lrwxr-xr-x 1 guiohm admin 31 Oct 11 15:58 /usr/local/include/lzma -> ../Cellar/xz/5.2.2/include/lzma
lrwxr-xr-x 1 guiohm admin 33 Oct 11 15:58 /usr/local/include/lzma.h -> ../Cellar/xz/5.2.2/include/lzma.h

奇怪的是当我检查配置日志时: 这个(./wxWidgets-3.0.2/bld/src/tiff/config.log)除了lzma还有其他错误,比如:

configure:18047: checking for lzma_code in -llzma
configure:18072: clang -o conftest -g -O2 -Wall -W  -stdlib=libc++ conftest.c -llzma  -ljpeg -lz  >&5
configure:18072: $? = 0
configure:18081: result: yes
configure:18096: checking lzma.h usability
configure:18096: clang -c -g -O2 -Wall -W  conftest.c >&5
configure:18096: $? = 0
configure:18096: result: yes
configure:18096: checking lzma.h presence
configure:18096: clang -E  conftest.c
configure:18096: $? = 0
configure:18096: result: yes
configure:18096: checking for lzma.h
configure:18096: result: yes
configure:18199: checking for X
configure:18307: clang -E  conftest.c
conftest.c:89:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^
1 error generated.
configure:18307: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "LibTIFF Software"
| #define PACKAGE_TARNAME "tiff"

See the full version.

Ans 和./wxWidgets-3.0.2/bld/config.log 差不多。

当我更改代码以允许使用 os10.10 SDK 时,它之前预计最高 10.8 或者可能是 10.9。我想现在整个问题都来自于此。 我应该尝试获取旧的 MacOS SDK 吗?

基本上,我只是想从源代码编译 Slic3r --gui,它需要 Wx,它需要 wxwidgets。

【问题讨论】:

标签: macos perl cpan wxwidgets


【解决方案1】:

这里的问题是 libtiff configure 在/usr/local 下检测到lzma.h,因为它不使用-isysroot,但由于SDK 选项,它的编译确实如此,并且无法找到它。正确的做法是在 wxWidgets 配置中显式使用-I/usr/local/include,但现在您应该可以通过使用export CPATH=/usr/local/include LIBRARY_PATH=/usr/local/lib 绕过它来解决这个问题。

或者(最好是恕我直言),执行brew install tiff jpeg png(不确定公式名称是否正确,请检查它们)以避免首先构建这些库的内置版本。

【讨论】:

    【解决方案2】:

    运行 brew install xz 为我解决了这个问题。

    见https://stackoverflow.com/a/37594849/6381715

    【讨论】:

      猜你喜欢
      • 2015-12-17
      • 2015-04-19
      • 2015-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-28
      相关资源
      最近更新 更多