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);
}
[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);
}
解决方案 »
- Oracle一个特别特别奇怪的问题
- 跨用户执行存储过程权限问题
- 如何更新远程oracle数据库(实现远程数据库与本地数据库同步)?
- 如何判断oracle数据库中是否存在某个表
- oracle listener无法启动?
- 如何实现SELECT权限授权
- 为什么asp.net连接oracle会显示乱码,而连接sqlserver就没事
- Oracle 技术论坛好家园(新版OTN 中文论坛)欢迎你的光顾!
- 关于database link 的问题,请高手指教。
- Pro*c 中where条件后面不能接数组变量?? 怎么varchar类型的也不行啊?
- oracle 存储过程与触发器
- 請問pl/sql 中產生隨機數的函數是什么﹖
[root@licheng ~]# echo '/usr/local/lib' >> /etc/ld.so.conf
就可以了