8

ブースト 1.37 と wxwidgets を含む Windows プロジェクトを Mac に移植しようとしています。それは問題なくコンパイルされますが、リンカーは libz.1.dylib に対して「ファイルはアーキテクチャ ppc に必要なアーキテクチャではありません」というエラーを表示し、他のいくつかのライブラリの警告と同じメッセージを表示します。また、libz.1.dylib に対して「dylib が重複しています」という警告が表示されます。

リンカーの出力は次のようになります。

プロジェクト「Gemsweeper Mac」のターゲット「Gemsweeper Mac」を構成「Debug」でビルド</p>

依存関係の確認

Ld "/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Debug/Gemsweeper Mac.app/Contents/MacOS/Gemsweeper Mac" normal i386
    cd "/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac"
    setenv MACOSX_DEPLOYMENT_TARGET 10.4
    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk "-L/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Debug" -L/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib -L/opt/local/lib "-F/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Debug" -F/Users/adriangrigore/Library/Frameworks -F/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks -filelist "/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/Debug/Gemsweeper Mac.build/Objects-normal/i386/Gemsweeper Mac.LinkFileList" -mmacosx-version-min=10.4 -L/opt/local/lib -L/Users/adriangrigore/wxwidgets-manual/wxMac-2.8.9/lib /opt/local/lib/libboost_system-mt.a /opt/local/lib/libboost_program_options-mt.a /opt/local/lib/libboost_thread-mt.a -arch ppc -arch i386 -framework IOKit -framework Carbon -framework Cocoa -framework System -framework QuickTime -framework OpenGL -framework AGL /Users/adriangrigore/wxwidgets-manual/wxMac-2.8.9/lib/libwx_mac-2.8.a -framework WebKit -lwxexpat-2.8 -lwxtiff-2.8 -lwxjpeg-2.8 -lwxpng-2.8 -lz -lpthread -liconv -framework SDL -framework Cocoa -o "/Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Debug/Gemsweeper Mac.app/Contents/MacOS/Gemsweeper Mac"
ld warning: in /Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/Debug/Gemsweeper Mac.build/Objects-normal/i386/main.o, file is not of required architecture
ld warning: in /Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/Debug/Gemsweeper Mac.build/Objects-normal/i386/variousfunctions-xcode.o, file is not of required architecture
ld warning: in /Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/Debug/Gemsweeper Mac.build/Objects-normal/i386/ParticleLayers.o, file is not of required architecture
ld warning: in /Users/adriangrigore/Documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/Debug/Gemsweeper Mac.build/Objects-normal/i386/SDLMain.o, file is not of required architecture
ld warning: in /opt/local/lib/libboost_system-mt.a, file is not of required architecture
ld warning: in /opt/local/lib/libboost_program_options-mt.a, file is not of required architecture
ld warning: in /opt/local/lib/libboost_thread-mt.a, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture
ld: in /opt/local/lib/libz.1.dylib, file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
ld warning: duplicate dylib /opt/local/lib/libiconv.2.dylib

私は Mac プラットフォームにまったく慣れていないので、どんな助けでも大歓迎です!

ありがとう、

エイドリアン

4

4 に答える 4

2

Mac 用のブーストを再ダウンロードまたは再構築する必要があるようです。そして、それを行う必要があるdylibが何であれ。簡単に言えば、ライブラリを再インストールするだけです。

ブーストを使用すると、すべてを再度ダウンロードする必要はありません。ソース自体はマルチプラットフォームであり、プラットフォームごとに変更されるのはバイナリ (ライブラリなど) だけです。すでにすべてのソースをダウンロードしている可能性があるため、ソースからライブラリを再構築するだけで済みます。http://www.boost.org/doc/libs/1_37_0/more/getting_started/unix-variants.htmlは、bjam を使用したブーストの構築に関する情報を提供します。Windows ではバイナリがプリコンパイルされていることは知っていますが、Mac 用のブースト Web サイトではそれについて何も確認できません。

于 2009-01-28T08:36:12.263 に答える
2

いただいたメッセージによると、Gemsweeper Mac と libboost のほとんどは、アーキテクチャとして ppc のみでコンパイルされています。ユニバーサル バイナリを生成するように Xcode を構成し、おそらく MacPorts を介して libboost を再コンパイルする必要があります。最近の MacPorts には「ユニバーサル」ターゲットがあり、ppc で実行する予定がない場合は、再コンパイルするだけで済みます。

zlib と libiconv も再コンパイルする必要があるようです。

于 2009-01-28T08:44:44.773 に答える
0

「ユニバーサル」の2つではなく、ネイティブアーキテクチャをターゲットにする必要があります。

これには、xcode のバージョンに応じて、xcode を「ビルド マシンのネイティブ アーキテクチャ」、「アクティブなアーキテクチャのみをビルド」、および「有効なアーキテクチャ」に設定することが含まれます。ただし、考えられるすべてのアーキテクチャ バリアントを消去します。

これは、デフォルトのブーストで./b2 installはネイティブ アーキテクチャしか得られないためです。

ブーストを再インストールしてみてください./b2 install toolset=intel

可能な(そして未試の)解決策は、ブーストを2回構築することです。

インテル./b2 install --prefix=/usr/local/x64 toolset=intel

ネイティブ./b2 install --prefix=/usr/local/ppc

于 2013-01-29T17:56:16.507 に答える
0

sudo port xxx install +universal を使用して zlib と libiconv (およびその他の多数の依存ライブラリ) をアンインストールして再インストールすると、役に立ちました。早速お返事をいただきありがとうございます!:-)

于 2009-01-28T14:22:14.577 に答える