注册 登录
编程论坛 C++教室

linux下能不能将新类放到动态连接库中?

yc_wei 发布于 2008-09-06 13:06, 517 次点击
新写了一个类,能不能将类放到动态连接库中去?
我是用g++ -fPIC -shared -o libCCfgFile.so CCfgFile.cpp 生成动态连接库的;
编译连接是用g++ -rdynamic -o temp temp.cpp -lCCfgFile
但编译时报错
temp.cpp: In function `int main(int, char**)':
temp.cpp:7: error: no matching function for call to `CCfgFile::CCfgFile(const char[36])'
CCfgFile.h:14: note: candidates are: CCfgFile::CCfgFile(const CCfgFile&)
CCfgFile.h:17: note:                 CCfgFile::CCfgFile(char*, int)
CCfgFile.h:16: note:                 CCfgFile::CCfgFile()
temp.cpp:9: error: no matching function for call to `CCfgFile::LoadFile(const char[28])'
CCfgFile.h:20: note: candidates are: void CCfgFile::LoadFile(char*, int)

请教教我
0 回复
1