ubuntu12.04不支持gobinding

尝试用gobinding去编写imagemagick

本人采用的系统是ubutu12.04,先前因为系统apt安装缺少库文件,我采用的是tar下载make install安装,这里给一个已经加入库文件的tar包

http://download.csdn.net/detail/u010026901/7642329

OK,接着去看官方的文档和github,按顺序执行

Ubuntu / Debian

sudo apt-get install libmagickwand-dev

Common

Check if pkg-config is able to find the right ImageMagick include and libs:

pkg-config --cflags --libs MagickWand

Then go get it:

go get github.com/gographics/imagick/imagick  //默认安装在第一个gopath的文件夹下

我就简单写了个demo

package main

import (

"fmt"

"github.com/gographics/imagick/imagick"

)

func main() {

imagick.Initialize()

defer imagick.Terminate()

mw := imagick.NewMagickWand()

defer mw.Destroy()

mw.ReadImage("/home/qboxtest/qbox/image/fop_ncgo/src/qbox.us/fop/imgave/samples/sample.jpg")

height := int(mw.GetImageHeight())

width := int(mw.GetImageWidth())

println(height, width)

pw := imagick.NewPixelWand()

defer pw.Destroy()

pw=mw.GetImagePixelColor(2, 2)//恭喜这里出问题,后查原因,应该是和tar包提供的库文件有冲突,编译没问题,执行歇菜

fmt.Println("xxxx", pw)

r := pw.GetRed()

g := pw.GetGreen()

b := pw.GetBlue()

a := pw.GetAlpha()

println("xxxxxxx", r, g, b, a)

rgb := int(10)<<16 | int(11)<<8 | int(12)

fmt.Printf("0x%06x", rgb)

}

接下来我卸载了自身安装的imagemagick,重新走流程,不管是否用apt安装imagemagick,始终报错

# command-line-arguments

/usr/bin/ld: cannot find -lMagickWand-6.Q16

/usr/bin/ld: cannot find -lMagickCore-6.Q16

collect2: ld returned 1 exit status

在usr/lib和usr/local/lib都找不到对应的库文件,也没有可安装的路子,也查找不到

[email protected]:~/Desktop$ apt-cache search ImageMagic*

groff - GNU troff text-formatting system

imagemagick - image manipulation programs

imagemagick-common - image manipulation programs -- infrastructure

imagemagick-dbg - debugging symbols for ImageMagick

imagemagick-doc - document files of ImageMagick

inkscape - vector-based drawing program

libmagick++-dev - object-oriented C++ interface to ImageMagick - development files

libmagick++4 - object-oriented C++ interface to ImageMagick

libmagickcore4 - low-level image manipulation library

libmagickwand4 - image manipulation library

libreoffice - office productivity suite

perlmagick - Perl interface to the ImageMagick graphics routines

tex4ht - LaTeX and TeX for Hypertext (HTML) - executables

tex4ht-common - LaTeX and TeX for Hypertext (HTML) - support files

ctioga - command-line plotting utility

drupal6-mod-imageapi - imageapi module for Drupal 6

drupal6-mod-imagecache - imagecache module for Drupal 6

用dpkg -S Magic*查看,发现ubuntu12.04自带的库是6.6.9版本的,但是gobinding要求6.8以上

[email protected]:~/Desktop$  dpkg -S Magic*

libmagickcore-dev: /usr/lib/libMagickCore.a

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/gradient.so

libmagickcore-dev: /usr/include/ImageMagick/magick/random_.h

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/html.la

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/ps2.la

libmagickcore-dev: /usr/include/ImageMagick/magick/memory_.h

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/sun.so

libmagickcore4: /usr/share/ImageMagick-6.6.9/english.xml

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/ipl.la

libmagickcore-dev: /usr/include/ImageMagick/magick/policy.h

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/pcx.la

imagemagick-common: /etc/ImageMagick/log.xml

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/sct.la

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/stegano.so

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/sgi.so

libmagickwand-dev: /usr/include/ImageMagick/wand/conjure.h

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/pix.la

libmagickcore4: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/art.so

这时候再去编译的时候发现编译不过

# github.com/gographics/imagick/imagick

37: error: ‘FlattenAlphaChannel‘ undeclared (first use in this function)

37: error: ‘RemoveAlphaChannel‘ undeclared (first use in this function)

时间: 2024-07-29 19:04:04

ubuntu12.04不支持gobinding的相关文章

Ubuntu12.04 安装PyCharm

原文地址 http://www.cnblogs.com/zhcncn/p/4027025.html 1. 下载 选择Linux Tab,选择下载免费的Community Edition[1].当前版本是3.4 2. 安装PyCharm 按照官网给出的安装指导[2]进行安装. (1) Copy the pycharm-*.tar.gz to the desired installation location (make sure you have rw permissions for that d

ubuntu12.04 启动apache2 对.htaccess 的支持

1.在 /etc/apache2/mods-enabled 目录下创建 ln -s ../mods-available/rewrite.load rewrite.load rewrite.load -> ../mods-available/rewrite.load rewrite.load文件中内容 LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so 终端运行 sudo a2enmod 程序提示可供激活的模块名称,输

VirtualBox中安装Ubuntu12.04/Ubuntu14.04虚拟机

NOTE: 一开始安装的Ubuntu12.04,后来又重新安装了14.04.截图基本使用了安装12.04时的截图,后来安装14.04时又补充了几张.该安装过程对Ubuntu12.04和14.04都是适用的. 1. 选择版本 1.1 Ubuntu桌面版与服务器版的区别 桌面版与服务器版,只要发布版本号一致,这两者从核心来说也就是相同的,唯一的差别在于它们的预期用途.桌面版面向个人电脑使用者,可以进行文字处理.网页浏览.多媒体播放和玩游戏.本质上说,这是一个为普通用户所定制的多用途操作系统.另一方面

ubuntu12.04+cuda6.0+caffe(新版)的安装

参照两位的博客 http://caffe.berkeleyvision.org/    官网 http://blog.csdn.net/u013476464/article/details/38071075    caffe+ubunutu14.04 +cuda 6.5 安装指南 http://blog.csdn.net/bebelemon/article/details/25567239   ubuntu12.04下配置caffe http://www.mintos.org/config/ub

ubuntu12.04的vim配置

ubuntu12.04中使用的vim的版本不支持像语法高亮和文件类型检测等配置 #sudo apt-get install vim vim默认的配置使用起来还不能让人满意,还需要自己配置默认配置文件是:/etc/vim/vimrc我们可以在家目录下建立自己的配置文件切换到~touch一个名为.vimrc的文件(以.开头的为隐藏文件) #cd ~#touch vimrc#vi .vimrc 输入以下配置:set nocompatible       不使用vi默认键盘布局  set number 

[分享]Ubuntu12.04安装基础教程(图文)

原文地址: http://teliute.org/linux/Ubsetup/lesson21/lesson21.html 1.进入 live cd 桌面 1)设置好启动后,断开网络,然后重新启动动计算机,能够用硬盘启动,也能够刻成光盘启动,镜像的下载地址: 进入后找蓝色链接点击下载,如 ubuntu-12.04-desktop-i386.iso,64位CPU能够下载amd64的版本号:http://mirrors.sohu.com/ubuntu-releases/12.04/ WinXP硬盘安

华科校园网内ubuntu12.04用锐捷客户端联网流程详解

刚开始一直都用mentohust联网,这个比较方便,只需要配置网络的基本属性,ip,网关等,然后安装mentohust的deb文件,再通过sudo mentohust 来配置用户名,密码等就成功了. 可是后来mentohust突然找不到服务器,一直以为是mentohust或者系统出了问题,实验室的小伙伴重复百遍,重装系统,重装mentohust,重新配置,依然不能上网,因为时间原因这个暂时放下了,而我当时也只是在windows下进行编程,所以也没太在意. 直到工作找完后意识到公司需要应聘者有li

intel dpdk在ubuntu12.04中測试testpmd、helloworld程序

一.測试环境 操作系统:ubuntu12.04   x86_64 dpdk版本号:1.6.0r2 虚拟机:vmware 10 网卡: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 二.測试准备 利用vmware 给 Ubuntu 12.04加入4块虚拟网卡.加入网卡的过程中选择的是默认的NAT模式. 三.測试过程 1.利用setup.sh測试testpmd程序 1).配置环境变量RTE_SDK 和

Ubuntu12.04 Version 安装二三事

Ubuntu12.04 Version 安装二三事 安装输入法 因为是全英的系统,所以,中文输入法是一定要装的!!! 介绍一:(和我电脑配置很像,from http://vb2005xu.iteye.com/blog/1748575) Ubuntu上的输入法主要有小小输入平台(支持拼音/二笔/五笔等),Fcitx,Ibus,Scim等.其中Scim和Ibus是输入法框架. 在Ubuntu的中文系统中自带了中文输入法,通过Ctrl+Space可切换中英文输入法.这里我们主要说下Ubuntu英文系统