Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何细分为C++;在Linux上从一个.so类中初始化?_Linux_Loadlibrary_Shared Libraries - Fatal编程技术网

如何细分为C++;在Linux上从一个.so类中初始化?

如何细分为C++;在Linux上从一个.so类中初始化?,linux,loadlibrary,shared-libraries,Linux,Loadlibrary,Shared Libraries,我正在使用ACE库做一些反应堆工作。在linux上,默认ACE编译输出是libACE.so。我通常使用-lACE compile选项编译它,但这取决于我是否在ld.so.conf.d目录中配置了libACE.conf。 如果我想将ACE_任务(可以从ACE.so导入)作为子类,那么编译依赖于libACE.so,如果我想动态加载ACE.so,我该怎么做? 我尝试过,如果使用dlopen,则会发生链接错误。 那么,有没有办法动态加载ACE.so,并且仍然可以像这样实现ACE_任务 class tes

我正在使用ACE库做一些反应堆工作。在linux上,默认ACE编译输出是libACE.so。我通常使用-lACE compile选项编译它,但这取决于我是否在ld.so.conf.d目录中配置了libACE.conf。 如果我想将ACE_任务(可以从ACE.so导入)作为子类,那么编译依赖于libACE.so,如果我想动态加载ACE.so,我该怎么做? 我尝试过,如果使用dlopen,则会发生链接错误。 那么,有没有办法动态加载ACE.so,并且仍然可以像这样实现ACE_任务

class test: public ACE_Task<ACE_MT_SYNCH>
{

}
类测试:公共ACE_任务
{
}

子分类主要发生在编译时。您需要在某些头文件中适当地定义超类

在运行时,重要的是vtables和继承的成员函数(也许还有RTTI)的可用性


您可能希望将
libACE.so
链接到您的共享对象(您正在构建的
dlopen
-ed对象)。这可以通过eg
g++-rdynamic-shared你的*.pic.o-lACE-o你的SharedObject.so

实现。那么你有没有用
ld.so.conf
配置库?我已经用ld.so.conf配置了它,这可以通过编译实现,但是当我想在另一台电脑上发布所有文件时,我必须配置ld.so.conf,有没有办法对from.so文件中的类进行子分类,并且我仍然可以在运行时加载它?