请问在linux中C语言是否可以调用QT生成的动态链接库?
如何可以调用该怎么实现?
如何可以调用该怎么实现?
解决方案 »
- 请问各位高手Linu下 c++宽字符的宽流和wcin/out和 cin/out的问题
- linux如何把一个程序交叉编译到板子上
- 虚拟机开不起来
- aix 6.1 可以用普通的鼠标USB键盘操作不。。
- linux 找不到eth0设备 启动eth0失败
- centos7下solr导入数据出现Data Config problem: 1 字节的 UTF-8 序列的字节 1 无效
- 虚拟机安装linux
- Python tensorflow tf.layers.batch_normalization
- 关于tunnel的建立,问什么添加不了路由呢
- nginx运行php文件显示File not found.
- centos6.5 设置FTP端口
- sar -n DEV和dstat -n流量监控的问题
简单弄个例子:
C++
class A{
public:
A(){}
~A(){}
void show(){}
};
//C code
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
void* A_new() {
return new A();
}
void A_show(void* a) {
a->show();
}
void A_destroy(void* a) {
delete a;
}
#ifdef __cplusplus
}
#endif // __cplusplus
reinterpret_cast<A*>(a)->show();
delete reinterpret_cast<A*>(a);
应不行吧, qt里是使用c++语言的。c++可以兼容c, 但 c应兼容不了c++.
在qt里使用c的动态库没问题.