के साथ काम नहीं करता है मैं मैकॉक्स पर जी ++ के साथ यूनिवर्सल बाइनरी बनाने की कोशिश कर रहा हूं। हालांकि, यह वास्तव में काम नहीं करता है।मैकोज़क्स पर जी ++ -र्च पीपीसी 64
#include <iostream>
using namespace std;
int main() {
cout << "Hello" << endl;
}
यह ठीक काम करता है:: मैं इस सरल डमी कोड के साथ की कोशिश की है
% g++ test.cpp -arch i386 -arch ppc -arch x86_64 -o test
% file test
test: Mach-O universal binary with 3 architectures
test (for architecture i386): Mach-O executable i386
test (for architecture ppc7400): Mach-O executable ppc
test (for architecture x86_64): Mach-O 64-bit executable x86_64
बहरहाल, यह नहीं करता है:
% g++ test.cpp -arch i386 -arch ppc -arch x86_64 -arch ppc64 -o test
In file included from test.cpp:1:
/usr/include/c++/4.2.1/iostream:44:28: error: bits/c++config.h: No such file or directory
In file included from /usr/include/c++/4.2.1/ios:43,
from /usr/include/c++/4.2.1/ostream:45,
from /usr/include/c++/4.2.1/iostream:45,
from test.cpp:1:
/usr/include/c++/4.2.1/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
/usr/include/c++/4.2.1/iosfwd:46:25: error: bits/c++io.h: No such file or directory
In file included from /usr/include/c++/4.2.1/bits/ios_base.h:45,
from /usr/include/c++/4.2.1/ios:48,
from /usr/include/c++/4.2.1/ostream:45,
from /usr/include/c++/4.2.1/iostream:45,
from test.cpp:1:
/usr/include/c++/4.2.1/ext/atomicity.h:39:23: error: bits/gthr.h: No such file or directory
/usr/include/c++/4.2.1/ext/atomicity.h:40:30: error: bits/atomic_word.h: No such file or directory
...
ऐसा क्यों है किसी भी विचार?
मै मैकॉक्स 10.6 पर हूं। मैंने एक्सकोड 3.2.2 स्थापित किया है जिसमें सभी एसडीके हैं जिनके साथ आता है। जीसीसी 4.2 डिफ़ॉल्ट है। जीसीसी 4.0 कुछ अलग त्रुटियों का उत्पादन करता है, हालांकि समान व्यवहार करता है।
स्पष्ट रूप से, ऐप्पल ने जीसीसी मैन पेज को अपडेट करने के लिए परेशान नहीं किया। – WhirlWind
वैसे यह वास्तव में एक जीसीसी मुद्दा नहीं है। यह है कि MacOSX10.6.sdk में कोई ppc64 नहीं है, न कि GCC ppc64 का समर्थन नहीं करता है। जीसीसी * करता है * अभी भी पीपीसी 64 का समर्थन करता है। 10.6 एसडीके में पीपीसी 64 समर्थन के साथ बस कोई सी ++ रनटाइम नहीं है। –
कूल, इसके लिए धन्यवाद! वह आदेश काम करता है। यह 10.4 एसडीके के साथ कैसा लगेगा? क्योंकि मैं इसे काम नहीं कर सकता। – Albert