2012-03-19 166 views
0

我安裝了Xcode 4.3.1。儘管所需的我收到未知類型名socklen_t錯誤包括SCNetwork.h未知類型名稱`socklen_t`

#ifndef _SCNETWORK_H 
#define _SCNETWORK_H 

#include <Availability.h> 
#include <sys/cdefs.h> 
#include <sys/types.h> 
#include <sys/socket.h> // required include 
#include <CoreFoundation/CoreFoundation.h> 

我失去了任何包括哪些內容?

從終端:

➜ ABC git:(master) ✗ xcodebuild 
=== BUILD NATIVE TARGET ABC OF PROJECT DEF WITH THE DEFAULT CONFIGURATION (Release) === 
Check dependencies 
2012-03-19 10:20:43.360 xcodebuild[42278:4403] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x401387be0 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory} 
2012-03-19 10:20:43.362 xcodebuild[42278:4403] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'objective-c'. 
Compiler: /usr/bin/gcc-4.2 
Reason: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x objective-c -c /dev/null 2>&1 
2012-03-19 10:20:43.410 xcodebuild[42278:4403] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x c -c /dev/null 2>&1" UserInfo=0x401523f80 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory} 
2012-03-19 10:20:43.411 xcodebuild[42278:4403] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. 
Compiler: /usr/bin/gcc-4.2 
Reason: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -x c -c /dev/null 2>&1 
Code Sign error: The identity 'iPhone Distribution' doesn't match any valid, non-expired certificate/private key pair in the default keychain 


** BUILD FAILED ** 


The following build commands failed: 
    Check dependencies 
(1 failure) 
+0

'''應該包含正確定義'socklen_t'所需的頭文件,所以你的項目或構建配置或某物可能會出錯。發佈預處理器輸出(通過** Product→Generate Output→Generate Preprocessed File **菜單選項)。 – 2012-03-19 04:08:19

+0

預處理文件未突出顯示。 – Ava 2012-03-19 04:12:40

+0

那又如何?如果您需要幫助,請發佈預處理器輸出。 – 2012-03-19 04:14:14

回答

0

導入SystemConfiguration框架。

+0

它在框架文件夾中。 'SCNtwork.h'只在該文件夾中。 – Ava 2012-03-19 03:37:32

+0

#import 2012-03-19 03:39:01

+0

仍然出現錯誤 – Ava 2012-03-19 03:40:38