我正在制作一个连接oracle DB的C程序。我已经正确安装了Oracle Instant Client和ocilib。
我确实编译了代码而没有任何错误但是当我执行程序时出现了以下错误。
./a.out: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
如果有人知道如何解决,请写下来 谢谢。
答案 0 :(得分:2)
是的,我通过将库的链接添加到appRoutes.route('/sign-up/organization')
.get(function(req, res){
models.User.find({
where: {
user_id: req.user.email
}, attributes: [ 'user_id', 'email'
]
}).then(function(user){
res.render('pages/sign-up-organization.hbs',{
user: req.user
});
})
})
.post(function(req, res, user){
models.Organization.create({
organizationName: req.body.organizationName,
admin: req.body.admin,
user: {
organizationId: req.body.organizationId
}
}, { include: [models.User] }).then(function(){
console.log(user.user_id);
res.redirect('/app');
}).catch(function(error){
res.send(error);
console.log('Error at Post');
})
});
来解决它。
使用以下命令。
/usr/lib
答案 1 :(得分:0)
确保已安装示例CD。 确保设置了环境变量LD_LIBRARY_PATH,并且可以为您登录的用户访问库文件(以权限方式)。
如果您已经检查了这些并仍然收到错误,请发布以下输出:
strace ./a.out
答案 2 :(得分:0)
LIBPATH环境变量应该指向包含libclntsh的lib32文件夹。
然后您需要在运行应用程序之前导出LIBPATH变量。
答案 3 :(得分:0)
从我的回答中复制:Eclipse CDT Auto Include Shared Libraries
以root身份运行 ldconfig 以更新缓存 - 如果仍然没有 help,你需要添加文件ld.so.conf的路径(只需输入它 在它自己的线上)或者更好的是,将条目添加到新文件(更容易 删除)目录ld.so.conf.d。