我正在尝试使用g ++在MacOSX上构建通用二进制文件.但是,它并没有真正起作用.我试过这个简单的虚拟代码:
#include <iostream>
using namespace std;
int main() {
cout << "Hello" << endl;
}
Run Code Online (Sandbox Code Playgroud)
这很好用:
% 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
Run Code Online (Sandbox Code Playgroud)
但是,这不是:
% 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: …Run Code Online (Sandbox Code Playgroud)