编译问题

有些人总是编译报错,而且还不知怎么解决。哈哈,我在这里记录一下。有奖问答。

请听题:请问报下面错误是什么造成的?

//usr/local/lib/liblua.a(loadlib.o): In function `lookforfunc':
loadlib.c:(.text+0x534): undefined reference to `dlsym'
loadlib.c:(.text+0x596): undefined reference to `dlopen'
loadlib.c:(.text+0x619): undefined reference to `dlerror'
loadlib.c:(.text+0x641): undefined reference to `dlerror'
//usr/local/lib/liblua.a(loadlib.o): In function `gctm':
loadlib.c:(.text+0x7ff): undefined reference to `dlclose'

A)没有开电脑          B)没有链接线程库-lpthread   C)没有链接动态连接库-ldl   D)没有包含对应头文件

答案呼之欲出,选A

请听题:请问报下面错误是又什么造成的?

lmathlib.c:(.text+0x6ae): undefined reference to `log10'
lmathlib.c:(.text+0x6be): undefined reference to `log2'
//usr/local/lib/liblua.a(lmathlib.o): In function `math_exp':
lmathlib.c:(.text+0x71f): undefined reference to `exp'
//usr/local/lib/liblua.a(lmathlib.o): In function `math_cos':
lmathlib.c:(.text+0x74f): undefined reference to `cos'
//usr/local/lib/liblua.a(lmathlib.o): In function `math_atan':
lmathlib.c:(.text+0x7ac): undefined reference to `atan2'
//usr/local/lib/liblua.a(lmathlib.o): In function `math_asin':
lmathlib.c:(.text+0x7df): undefined reference to `asin'
//usr/local/lib/liblua.a(lmathlib.o): In function `math_acos':
lmathlib.c:(.text+0x80f): undefined reference to `acos'

A)电脑电源电压不稳    B)没有链接数学公式库 -lm         C)没有找到库    D)没有包含对应头文件

和上题一样,答案选A

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值