- 论坛徽章:
- 0
|
报错了!
/root/SunStudioProjects/SubProjects_1/hello3lib/dist/Debug/SunStudio_12.1-Linux-x86/libhello3lib.so: undefined symbol: hello3
我使用的是sunstudio中的例子,只不过那里面是直接include后使用的
我不想包含到项目中来。
- F_TESECSO ftestcso;
- handle = dlopen("/root/SunStudioProjects/SubProjects_1/hello3lib/dist/Debug/SunStudio_12.1-Linux-x86/libhello3lib.so",RTLD_LAZY);
- std::cout << "test1" << std::endl;
- ftestcso = (F_TESECSO)dlsym(handle,"hello3");
- std::cout << "test2" << std::endl;
- if((error=dlerror())!=NULL)
- {
- std::cout << "test3" << std::endl;
- fputs(error,stderr);
- exit(1);
- }
- std::cout << ftestcso() << std::endl;
复制代码 执行的时候就直接跑到输出test3了。 |
|