自ubuntu升级以来未定义对dlopen的引用 [英] undefined reference to `dlopen' since ubuntu upgrade

查看:139
本文介绍了自ubuntu升级以来未定义对dlopen的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我已经升级到ubuntu 13.10和gcc 4.8.1,因此我遇到了对dlopen问题的不确定引用.

i experience the undefined reference to `dlopen' problems since I have upgraded to ubuntu 13.10 and gcc 4.8.1.

makefile已经使用多年了.特定的通话是

The makefiles are working for years already. the particular call is

gcc -rdynamic -o ov_dbutil ov_dbutil.o libov.so -ldl

错误是:

libov.so: undefined reference to `dlopen'
libov.so: undefined reference to `dlclose'
libov.so: undefined reference to `dlerror'
libov.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make: *** [ov_dbutil] Error 1

这是gcc问题吗?

ov_dbutil用以下几行编译

ov_dbutil is compiled with the following lines

gcc -g -Wall -O0 -shared -std=c99 -fno-strict-aliasing   -DPLT_SYSTEM_LINUX=1 -DPLT_USE_BUFFERED_STREAMS=1 -DPLT_SERVER_TRUNC_ONLY=1 -DNDEBUG   -DOV_SYSTEM_LINUX=1    -I../../../plt/include/ -I../../../ks/include/ -I../../include/ -I../../model/ -I../../source/codegen/ -I../../source/builder/ -I../../source/example/ -I../../source/kshist/ -I../../source/dynov/ -I../../source/tasklib/ -I../../source/dbparse/ -I../../source/dbdump/ -I../../../../libml/ -I../../include/runtimeserver/ -I. -c ../../source/dbutil/ov_dbutil.c -o ov_dbutil.o

没有错误或警告

推荐答案

我的问题已通过在.so的内衬行中添加-ldl来解决,因此您想再次链接,在上例中将其称为libov.so.

My issue was solved by adding -ldl in the lining line of the .so you want to link agains, it was called libov.so in the upper example.

这篇关于自ubuntu升级以来未定义对dlopen的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆