问题记录vips.h:133: undefined reference to `vips_reduce‘ collect2: error: ld returned 1 exit status
@[TOC]背景
ubuntu下go build 出错:
# github.com/h2non/bimg
/tmp/go-build2910330990/b131/_x005.o: In function `vips_reduce_bridge':
../../pkg/mod/github.com/h2non/bimg@v1.1.9/vips.h:133: undefined reference to `vips_reduce'
collect2: error: ld returned 1 exit status
# github.com/h2non/bimg
In file included from ../../pkg/mod/github.com/h2non/bimg@v1.1.9/vips.go:5:0:
../../pkg/mod/github.com/h2non/bimg@v1.1.9/vips.h: In function ‘vips_reduce_bridge’:
../../pkg/mod/github.com/h2non/bimg@v1.1.9/vips.h:133:9: warning: implicit declaration of function ‘vips_reduce’ [-Wimplicit-function-declaration]
return vips_reduce(in, out, xshrink, yshrink, NULL);
^
@[TOC]主要原因
https://github.com/deso-protocol/backend/issues/84
https://github.com/libvips/libvips/issues/1844
即需要更新libvips包到高版本(最新也可)。如未安装该包,则会提示:
No package 'vips' found
Package vips was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vips' found
pkg-config: exit status 1
install一下即可解决。
@[TOC]排查手段
查看版本(成功时)
vips -v
vips-8.2.2-Sat Jan 30 17:12:08 UTC 2016
如未安装则会提示。
@[TOC]解决办法
首先安装几个必要的包:
apt-get install build-essential libvips-dev libglib2.0-dev libexpat1-dev
备份源
cp /etc/apt/sources.list /etc/apt/sources.list.bk
更新源
vim /etc/apt/sources.list
内容如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
执行更新:
sudo apt-get update
可先尝试更新libvips-dev
apt-get upgrade libvips-dev
如有报错 或 更新成功了但尝试再次编译还是不成功的话,继续看下一步。
按依赖识别更新所有包:
apt-get dist-upgrade
再次查看
vips -v
vips-8.4.5-Wed Jan 18 12:36:44 UTC 2017
可以看到本部已更新。
@[TOC]最终成功时的pkg-config的环境变量
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
问题记录vips.h:133: undefined reference to `vips_reduce‘ collect2: error: ld returned 1 exit status相关推荐
- gcc报(.text+0x24): undefined reference to `main‘collect2: error: ld returned 1 exit status解决方法
我已经记不清自己为什么这样解决了,重新搜索了一下也没发现类似的答案. 由于实验需要,我需要编译这个例子: https://github.com/grimm-co/GEARSHIFT/blob/trun ...
- NS2:undefined reference to `xxx' collect2: error: ld returned 1 exit status
这个问题是没有链接. 刚开始先确认,头文件有没有导入. 以下是完整的提示信息错误,检查之后发现hdr_ant_pkt所在的头文件已经被导入: In function `hdr_ant_pkt::acc ...
- 编译报错file format not recognized和collect2: error: ld returned 1 exit status记录
报错啦! 年少无知不懂事,在编译多文件的时候使用了*来编译所有文件 ,于是报了这个错 ld: cannot find res: file format not recognized collect2: ...
- VScode报错:undefined reference to ‘WinMain’ collect2.exe: error: ld returned 1 exit status
X:/MinGw/mingw64/bin/-/lib/gcc/x86_64-w64-mingw32/8.1.0/-/-/-/-/x86_64-w64-mingw32/lib/-/lib/libming ...
- undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
[root@localhost dss]# gcc -o abc abc.cpp /tmp/ccY3hmyr.o(.eh_frame+0x11): undefined reference to `__ ...
- lua-5.2.3编译问题记录quot;libreadline.so: undefined reference to `PC#39;quot;
作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linu ...
- [CentOS]CentOS下编译CPP文件时报错[undefined reference to `__gxx_personality_v0' collect2: ld]的解决办法...
在CentOS环境下编译CPP时报出 undefined reference to `__gxx_personality_v0' collect2: ld 以上错误,调查了一下,加上参数[-lstdc ...
- 【ubuntu-qt-dlib】 配置问题 (一) undefined reference to `XPending'
问题描述:undefined reference to `XPending' source.o: In function `dlib::gui_core_kernel_2_globals::event ...
- Caffe编译错误记录(../lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'....)
编译caffe出错如下,百思不得其解,错误如下: 86%] Linking CXX executable train_net ../lib/libcaffe.so: undefined referen ...
最新文章
- react-native安装Ant Design
- SQL Server 2008高可用性系列:数据库快照
- Python 中的匿名函数,你滥用了吗?
- 非接触式IC智能(射频)卡
- Pyhton注释符号使用方法及规范
- OutputDebugString输出调试信息
- Would It affect RAC clusterware and database If we adjust OS time/Clock?
- HTML5+CSS3之字体的下载使用
- 官网下载mysql源码
- 轻量应用服务器腾讯云,腾讯云轻量应用服务器 ECS云服务器使用对比
- Unity IOS微信登录
- c语言中int和void,关于指针:void(*)void和int(*)int在C中的含义是什么?
- 智能对话机器人开发实战案例剖析(2)
- Latex最后一页文本或参考文献左右对齐(平衡)
- 将特殊的字符串转换为字典
- php blog 博客程序那个好
- Java RMI学习与解读(二)
- 科学计算与matlab语言期末答案,科学计算与MATLAB语言答案
- 传统的DHTML模型
- Altium Designer使用方法(DRC警告设置,走线技巧,DIY电路板打印技术)
热门文章
- 远程锁定计算机,利用Microsoft帐户来远程退出并锁定你的Windows 10电脑
- 【生成报名号+缴费成功】不代表考研报名成功!
- linux abs函数怎么用,Linux输入子系统详解
- 闲话链表的诞生以及它与数组亲缘关系的故事
- 2019,无数人改变命运的绝佳之年!(深度)
- 第001讲:我和Python的第一次亲密接触 | 课后测试题及答案
- 基于射频RFID智能刷卡门禁系统设计(毕设课设)
- python爬虫 requests+lxml爬取前程无忧网之模拟浏览器登录
- 材料化学博士后-谷歌offer的转行总结 -- 转自一亩三分地
- 制作minist格式的图像数据集