【发布时间】:2011-02-07 10:01:16
【问题描述】:
我正在使用 Roguewave 库从 C++ 连接到 Sybase 数据库。我了解数据库对象的构造为:
RWDBManager::database("accessLib", "", "", "", "", "XA=lrm_name");
http://www2.roguewave.com/support/docs/sourcepro/edition8/html/dbxaug/5-3.html 说
All arguments are of type RWCString. Note that establishing an XA connection to the Sybase CT database requires only two of the six database() arguments, as described here:
accessLib
The argument for the first parameter is the same as that which you provide for the non-XA connection.
For static libraries, supply the string "SYBASE_CT".
For shared libraries, supply the name of your shared access library, for example "libctl420d.so".
我不明白:
在代码中,我习惯于看到当我们必须使用库中提供的东西时,包括该库的标头,使用该库中的类/函数,然后在编译您的项目时在 LDLIBARIES 列表中使用该库。为什么这里的函数数据库需要库的NAME?与#include 方法相比,这种方法有哪些优势。
这是一些标准技术吗?这个一般用在什么地方? 我从事过使用共享库的项目,因此链接不是静态完成的,但我还没有遇到过这样的事情。
谢谢,
【问题讨论】:
-
根据 Roguewave 数据库文档,他们正在使用 dlopen 动态加载此共享库。我的下一个问题是为什么 Roguewave 选择了这种设计。他们可能只是动态链接这个共享库,但也没有动态加载这个。
-
编辑你的问题,就是这样:)
标签: c++ plugins linker compilation rogue-wave