2012-02-22 26 views
9

Hãy cho tôi biết, vị trí của stdlib.h trong XCode 4.3 là gì?Vị trí của stdlib.h trong XCode 4.3 là gì?

+1

không thể nói khoảng 4.3, nhưng trên máy tính của tôi với XCode 4.2 'locate stdlib.h | grep/stdlib \ .h $ 'kết quả đầu ra ' /Developer/SDKs/MacOSX10.6.sdk/usr/include/C++/4.2.1/tr1/stdlib.h' '/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdlib.h' '/ usr/include/C++/4.2.1/tr1/stdlib.h' '/usr/include/stdlib.h' –

+0

@darkmist Apple đã đóng gói Xcode 4.3 vào đĩa đơn gói ứng dụng, và bây giờ nó khá khó để tìm thấy những thứ ... –

Trả lời

7

Có gì trong số /Developer trong các phiên bản Xcode trước 4.3 hiện nằm trong gói Xcode.app. Có một số, một cho mỗi SDK và Nền tảng được hỗ trợ:

$ find /Applications/Xcode.app -name stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/c++/4.2.1/tr1/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/c++/4.2.1/tr1/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/tr1/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/stdlib.h 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/stdlib.h 
+0

Cảm ơn bạn rất nhiều! Bạn đã nói với tôi không chỉ nơi để tìm thấy nó, mà còn về một cách tuyệt vời để tìm các tập tin tiêu đề khác! –

1

Tôi nghĩ bạn nên sử dụng unistd.h thay vì stdlib.h. Tôi gặp sự cố khi cố gắng sử dụng chế độ ngủ() khi nhập stdlib.h và tôi phải nhập unistd.h.

+0

OK. Bạn có thể cho tôi biết vị trí của unistd.h sau đó? –

+1

Tại /usr/include/unistd.h – larick

+0

[stdlib] (http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html) được chỉ định bởi POSIX. Bạn không cần phải làm việc xung quanh nó. bames53 (bên dưới) có câu trả lời đúng (giải pháp chung, ngay cả đối với các dòng lệnh không phải Xcode). trojanfoe (ở trên) đã trả lời một câu hỏi chưa được hỏi (liên quan đến Xcode builds). Ngoài ra, đôi khi bạn không có loại vĩ độ đó (stdlib.h -> unistd.h) – jww

5

Nếu bạn cài đặt các công cụ dòng lệnh (Xcode> Tùy chọn> Tải xuống), thì tệp có mặt tại /usr/include/stdlib.h.

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