2013-09-08 21 views
9

için oluşturulan dylib'e bağlanma 15 Nisan 2013 komut satırı araçlarıyla Xcode 5 beta sürümüne yeni sürüme geçtim ve standart CMakeTestCCompiler.cmake girişimi sırasında bir cmake yapısı çalıştırırken aşağıdaki uyarıya geçtimMacOSX için Yapılandırma, ancak iOS Simulator dosyası

cmake -version 
cmake version 2.8.11.2 

ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib' for architecture i386 

lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib 
Non-fat file: libSystem.dylib is architecture: i386 

derleme adımdır:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -o /Users/temp/testCCompiler.c.o -c /Users/temp/testCCompiler.c 

lipo -info /Users/temp/testCCompiler.c.o 
Non-fat file: testCCompiler.c.o is architecture: i386 

bağlantı adımdır:

/usr/local/bin/cmake -E cmake_link_script /Users/temp/link.txt --verbose=1 
basit bir test programı derlemek link.txt içeren

:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -Wl,-headerpad_max_install_names /Users/temp/testCCompiler.c.o -o testCCompiler 

O testCCompiler.co ve libSystem.dylib hem i386 link.txt içinde i386 belirtilen gibi görünüyor ve i386 i' böylece simülatör için doğru mimaridir MacOSX için neden yapıldığını düşündüğünden emin değilim. Belki bir komut seçeneği :(yanlıştır. Herhangi bir yardım için

teşekkürler!

+1

cmake kaynağına Dug'la ve cmake tarafından sunulan çiğ bağlantı komutu geçerli: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/ Geliştirici/usr/bin/gcc -arch i386 -isysroot /Uygulamalar/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -Wl, -headerpad_max_install_names/Kullanıcılar/temp/testCCompiler. co -o testCCompiler – user1031420

+4

Sorun, Xcode 5'in gcc'yi clang ile değiştirmesi ve OSX'i hedef olarak belirten bir "-triple" seçeneğinin eklenmesiydi. Her iki gcc komut satırında "-miphoneos-version-min = 7.0" iletirseniz çalışır. "--verbose" ifadesini gcc'ye geçirirseniz, clang komut satırını görebilirsiniz. Ayrıca, Cmake'nin gerekli araçları bulabilmesi için Xcode 5 için PATH'a eklenmesi de gereklidir: export PATH =/Uygulamalar/Xcode5-DP6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Uygulamalar /Xcode5-DP6.app/Contents/Developer/usr/bin:$PATH Bunların hiçbiri resmi değil .. ama şimdiye kadar çalışıyor. – user1031420

+1

Bu, bir yorumdan çok bir cevaba benziyor. – rjmunro

cevap

22

sorun Xcode 5 clang gcc değiştirir ve hedef olarak OSX belirten bir "-triple" seçeneğinde ekler olmasıydı. Eğer her iki gcc komut satırında "-miphoneos-version-min = 7.0" komutunu çalıştırır. "--verbose" ifadesini gcc'ye iletirseniz, clang komut satırını görebilirsiniz. Ayrıca Xcode 5 için PATH'a eklemeniz gerekir. cmake gerekli araçları bulabilirsiniz: ihracat PATH =/Uygulamalar/Xcode5-DP6.app/İçerik/Geliştirici/Toolchains/XcodeDefault.xct‌ oolchain/usr/bin: /Applications/Xcode5-DP6.app/Contents/Developer/usr/ bin: $ PATH Bu durumun hiçbiri resmi değil .. ama şu ana kadar çalışıyor:

+0

Bu yöntem, Xcode 5.0.2 kullanarak benim için başarılı oldu. –

0

çalıştırmak için client.app bu açıklama:

export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xct‌oolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH 
İlgili konular