2011-08-18 32 views
34

tôi sử dụng xcode4, trên một dự án OpenGLES tôi đã thêm mã cho mua trong ứng dụng từ hướng dẫn: http://www.raywenderlich.com/2797/introduction-to-in-app-purchaseský Không xác định cho kiến ​​trúc i386: "_SCNetworkReachabilitySetCallback"

tôi đã thêm SystemConfiguration.framework nhưng lỗi này xảy ra :

Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 
    cd /Users/Eros/Desktop/blatestDB 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest 

Undefined symbols for architecture i386: 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in Reachability.o 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability currentReachabilityStatus] in Reachability.o 
     -[Reachability connectionRequired] in Reachability.o 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in Reachability.o 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in Reachability.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

nếu tôi xóa tham chiếu khung là giống nhau. thêm lần nữa không có gì xảy ra ... trong -Xlinker 2 -framework Foundation -framework UIKit [...] tôi có nên xem "-framework SystemConfiguration" đúng không? tại sao không có? có ai có ý tưởng không?

kéo lên khuôn khổ từ dự án-> xây dựng phases-> liên kết nhị phân với thư viện khiến nó trở thành khuôn khổ đầu tiên tôi có erros này:

Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 
    cd /Users/Eros/Desktop/blatestDB 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework SystemConfiguration -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest 

ld: warning: ignoring file /Users/Eros/Desktop/blatestDB/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file 
Undefined symbols for architecture i386: 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in Reachability.o 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability currentReachabilityStatus] in Reachability.o 
     -[Reachability connectionRequired] in Reachability.o 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in Reachability.o 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in Reachability.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

SystemConfigura là có, lỗi vẫn còn ... nó có thể là gì? cảm ơn

Trả lời

51

tìm thấy nó! tôi đã sao chép SystemConfiguration.framework vào thư mục dự án của tôi (kiểm tra hộp khi tôi thêm từ xcode). xóa thư mục đó trong dự án của tôi hiện đang biên dịch tốt

0

Tôi muốn chỉ ra rằng tôi cũng có vấn đề về mô phỏng này.

Tôi đã sao chép một số tệp qua xcode và vô tình có "ProjectTests" được chọn thay vì dự án. Chỉ cần xóa các tệp và thêm lại chúng vào dự án của bạn để đảm bảo dự án chính (không phải kiểm tra đơn vị) được chọn

0

Tôi gặp sự cố tương tự sau khi cập nhật từ repo.

Giải pháp hiệu quả đối với tôi là xóa tham chiếu khỏi dự án cho tất cả các lớp và thêm lại chúng. Vấn đề là có một khả năng lớn để làm hỏng đồng bộ hóa repo.

+0

Bạn đã làm điều này như thế nào? – quantumpotato

10

Tôi cũng có cùng một vấn đề. Tôi đã thêm một số khung trực tiếp bằng cách kéo và thả chúng.

Để giải quyết nó, tôi đã xóa tất cả trong số họ và thêm chúng thông qua menu Target> Xây dựng giai đoạn và sau đó lại thêm tất cả các khuôn khổ cần thiết thông qua Liên kết Binary Với Libraries.

Sau đó, mã của bạn sẽ hoạt động tốt trở lại.

+0

+1 cảm ơn u nó hoạt động ....! – Dinesh

37

Sau khi thêm SystemConfiguration.framework từ xây dựng giai đoạn dự án của tôi biên dịch cũng ...

có một niềm vui ...!

+1

Cảm ơn ... đã làm việc cho tôi! –

+1

đây là câu trả lời đúng nhất –

+0

Cảm ơn !!! Cái này cũng có tác dụng với tôi! – ChemDev

8

thật đơn giản.

scnetworkreachability callback được dán nhãn là biểu tượng không xác định trong đó hàm ý một số thư viện hoặc khung tập tin là mất tích

tiền tố sc nghĩa cấu hình hệ thống

  • nhấp chuột vào tên dự án chọn Tóm tắt ở bên phải

  • cl ick nhị phân liên kết và các khuôn khổ

  • nhấp chuột cộng vào nó sau đó bạn có thể thấy một mũi khoan xuống với bộ sưu tập của khuôn khổ và libaries xem nếu có bất cứ điều gì gọi là systemConfigurationframework

  • chọn đó và nhấn ok

  • Bây giờ xây dựngchạy vấn đề là giải quyết

5

Khi tôi đã sử dụng AFNetworking, sau khi nhận được các lỗi nhập khẩu 3 khung

CFNetwork.framework 
Security.framework 
SystemConfiguration.framework 

Tất cả lỗi sẽ biến mất .. thưởng thức !!!

5

Như đã đề cập ở trên, sau khi nhập 3 khung sau, nó hoạt động!

CFNetwork.framework 
    Security.framework 
    SystemConfiguration.framework 

Cảm ơn rất nhiều!

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