//test.cpp如下
#include <iostream>
using namespace std;
int main()
{
cout<<"this is a test."<<endl;
return 0;
}
1.生成exe文件的命令如下:g++ test.cpp -o test
生成成功后,执行exe命令为:./test
如果在生成exe文件的时候,需要调用新的.so文件,则命令如下:g++ test.cpp a.so -o test
2.生成.so文件的命令如下:g++ test.cpp -fPIC -shared -o test.so