#include //include位置:/usr/include
#include
using namespace std;
int main() {
cout << "Hello World" <
return 0;
}
g++ -o test test.cpp //用g++ gcc编译会出错
ldconfig 动态加载so库?!
g++ iga.cpp -lcjson -o iga
#include
using namespace std;
int main() {
cout << "Hello World" <
return 0;
}
g++ -o test test.cpp //用g++ gcc编译会出错
ldconfig 动态加载so库?!
g++ iga.cpp -lcjson -o iga
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c iga.cpp -o build/temp.linux-x86_64-2.7/iga.o -lcjson -lpython2.7 g++ -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/iga.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/iga.so -lcjson -lpython2.7 python distribute.py
本文展示了如何使用g++编译器来编译和链接一个简单的C++程序,并介绍了不同编译选项的作用,例如使用多线程库、Python库等。
1283

被折叠的 条评论
为什么被折叠?



