2009-01-28 20 views
8

Tôi đang cố gắng chuyển một dự án cửa sổ bao gồm tăng 1,37 và wxwidgets lên máy Mac. Nó biên dịch ok, nhưng trình liên kết cho tôi một "tệp không phải là kiến ​​trúc cần thiết cho kiến ​​trúc ppc" lỗi cho libz.1.dylib và cùng một thông báo như một cảnh báo một vài thư viện khác. Tôi cũng nhận được cảnh báo "trùng lặp dylib" cho libz.1.dylib.Vấn đề liên kết Xcode/GCC: tệp không phải là kiến ​​trúc bắt buộc

Kết quả mối liên kết trông như thế này:

Xây dựng mục tiêu “Gemsweeper Mac” của dự án “Gemsweeper Mac” với cấu hình “Debug”

Dependencies Kiểm tra

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 

Tôi khá mới với Mac plattform, vì vậy bất kỳ trợ giúp sẽ được đánh giá rất nhiều!

Cảm ơn,

Adrian

Trả lời

2

Từ các thư bạn đã có, hầu hết Gemsweeper Mac và libboost đã được biên dịch chỉ với ppc làm kiến ​​trúc. Bạn nên cấu hình Xcode để tạo các tệp nhị phân phổ biến và có thể biên dịch lại libboost thông qua MacPorts. MacPort gần đây có một mục tiêu "phổ quát" có thể giúp mặc dù nếu bạn không có kế hoạch chạy nó trên ppc, bạn chỉ cần biên dịch lại nó.

Bạn dường như cần phải biên dịch lại zlib và libiconv.

2

Âm thanh như bạn cần phải download lại hoặc xây dựng lại tăng cho Mac. Và bất cứ điều gì dylib là bạn cần phải làm điều đó. Nói một cách đơn giản, bạn thực sự chỉ cần cài đặt lại các thư viện.

Với việc tăng cường bạn không cần phải tải xuống lại toàn bộ nội dung một lần nữa, bản thân các nguồn là đa nền tảng, nó chỉ là các tệp nhị phân (libs và như vậy) thay đổi từ nền tảng này sang nền tảng khác. Rất có thể bạn đã tải xuống tất cả các nguồn, vì vậy bạn sẽ chỉ cần xây dựng lại thư viện từ các nguồn. http://www.boost.org/doc/libs/1_37_0/more/getting_started/unix-variants.html cung cấp cho bạn một số thông tin về việc tăng cường sử dụng bjam. Tôi biết trên các cửa sổ họ đã biên dịch trước nhị phân nhưng tôi không thể thấy bất cứ điều gì về điều đó trên trang web tăng cường cho Mac.

0

Gỡ cài đặt và cài đặt lại zlib và libiconv (cộng với hàng tá lib phụ thuộc khác) với sudo port xxx install + universal đã giúp. Cảm ơn vì đã phản hồi sớm! :-)

+0

4 năm là cheetah tốc độ.trong thực tế, nó cho peeps khác bằng cách sử dụng asio trong tương lai. tôi chạy trên cùng một vấn đề và nó đã cho tôi 1 ngày hoặc nhiều hơn để giải quyết vấn đề bị nhầm lẫn. bây giờ lỗi ssl của nó. bạn đã thử máy chủ ssl chưa. –

0

bạn cần nhắm mục tiêu kiến ​​trúc gốc, không phải là hai .. của 'phổ quát'.

liên quan đến việc đặt xcode thành 'Kiến trúc bản địa của máy xây dựng', 'Chỉ xây dựng kiến ​​trúc hoạt động' và 'Kiến trúc hợp lệ' tùy thuộc vào phiên bản xcode của bạn. nhưng làm sạch tất cả các biến thể kiến ​​trúc có thể có.

và thats vì tăng với mặc định ./b2 install sẽ chỉ nhận được kiến ​​trúc gốc.

thử cài đặt lại tăng với ./b2 install toolset=intel

một giải pháp khả thi (và chưa được thử nghiệm) đang xây dựng tăng gấp đôi.

intel ./b2 install --prefix=/usr/local/x64 toolset=intel

mẹ đẻ ./b2 install --prefix=/usr/local/ppc

Các vấn đề liên quan