मैं निर्यात पथ आदेश जारी किए गए हैं, और फिर hello.c संकलित करने के लिए कोशिश की, लेकिन संकलन में विफल रहता है, क्योंकि यह फ़ाइल stdio नहीं मिल रहा है ज। इसलिए, मैंने पूर्ण पथ/अनुप्रयोग /Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdio.h निर्दिष्ट करने के लिए शामिल कथन को बदल दिया, लेकिन फिर संकलन विफल रहता है क्योंकि इसे 3 अन्य .h फाइलें नहीं मिलती हैं।
export PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin
cat hello.c
#include <stdio.h>
int main()
{
printf("Hello World \n");
}
gcc hello.c -o hello
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:4: warning: incompatible implicit declaration of built-in function ‘printf’
gcc hello.c -o hello
In file included from hello.c:2:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdio.h:64:23: error: sys/cdefs.h: No such file or directory
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdio.h:65:26: error: Availability.h: No such file or directory
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdio.h:67:20: error: _types.h: No such file or directory
स्रोत
2013-02-14 17:28:35
यह ऐप्पल के हिस्से पर एक त्रुटि थी; उन्हें लगता है कि प्रत्येक एक्सकोड अपडेट के साथ यह समस्या है। कमांड लाइन टूल्स को भुगतान करने वाले डेवलपर खाते की आवश्यकता नहीं होती है। उन्हें एक्सकोड> वरीयताओं> डाउनलोड से स्थापित करने का प्रयास करें। –