error while loading shared libraries: libsqlora8-2.3.so.0

gengzhizhen 2009-07-17 03:25:20
GCC编译程序出错


[root@licheng ~]# gcc -lsqlora8 ./test.c -o test
最后一次编译成功,但是执行却出现错误

首先以root用户执行
[root@licheng ~]# ./test
./test: error while loading shared libraries: libsqlora8-2.3.so.0: cannot open shared object file: No such file or directory

再以oracle用户执行
[oracle@licheng ~]$ ./test
./test: error while loading shared libraries: libsqlora8-2.3.so.0: cannot open shared object file: No such file or directory

请教牛人这是怎么回事?


test.c内容如下:
#include <stdio.h>
#include <stdlib.h>
#include "sqlora.h"
static CONST char * _defuser="hr/hr@mydata";
int main(int argc,char **argv)
{
sqlo_db_handle_t dbh;
CONST char * cstr = _defuser;
char server_version[100];
if (SQLO_SUCCESS!= sqlo_init(SQLO_OFF,1,100))
{
printf("Failed to init libsqlora8\n");
return EXIT_FAILURE;
}
if (SQLO_SUCCESS != sqlo_connect(&dbh,cstr))
{
printf("Cannot login with %s \n",cstr);
return EXIT_FAILURE;
}
if (SQLO_SUCCESS != sqlo_server_version(dbh,server_version,sizeof(server_version)))
{
printf("Failed to get the server version: %s\n", sqlo_geterror(dbh));
return EXIT_FAILURE;
}
printf("Connected to:\n%s\n\n", server_version);
}
...全文
130 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
gengzhizhen 2009-07-17
  • 打赏
  • 举报
回复
执行
[root@licheng ~]# echo '/usr/local/lib' >> /etc/ld.so.conf
就可以了

17,382

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧