Ai
1 Star 1 Fork 1

py-zxj-free/dllload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
testlib.cpp 656 Bytes
一键复制 编辑 原始数据 按行查看 历史
py-zxj-free 提交于 2021-05-22 09:48 +08:00 . 'V1.0'
#include "metaObject.h"
//g++ -Wall -shared -fPIC -o test.so testlib.cpp
#include <iostream>
#include <string>
class MetaObject_child : public MetaObject {
public:
virtual int add(int a, int b) const
{
return a+b;
};
virtual void setVal(int _val){
val = _val;
};
virtual int getVal() const{
return val;
};
private:
int val;
};
// the class factories
extern "C" MetaObject* create() {
return new MetaObject_child;
}
extern "C" void destroy(MetaObject* p) {
delete p;
}
extern "C" {
void testfunc01(int a){
std::cout << "a="<<a<<std::endl;
}
int testfunc02(int b)
{
return b*b;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/pyzxjfree/dllload.git
git@gitee.com:pyzxjfree/dllload.git
pyzxjfree
dllload
dllload
master

搜索帮助