so文件为动态链接库文件,与windows下的dll文件相当,linux下系统so文件一般保存在/usr/lib中。
下面就说明一下如何生成c++程序的so文件,以及如何在c++程序中调用该so文件
==========test.h===========
#ifdef __cplusplus //
extern "C"
{
#endif
class Test{
public:
int hello(int i);
};
int helloT(int j);
#ifdef __cplusplus
}
#endif
==========test.cpp===========
#include"test.h"
#include<iostream>
using namespace std;
int Test::hello(int i){
if(i>3)
cout<<&