hzw435 发表于 2016-3-28 14:47:28

移植cconv到openwrt出错,恳请各位编译大神支招“undefined reference to”



cconv是一个可以把简体中文和繁体中文互相转换的程序,类似iconv。openwrt的package里面有iconv,但iconv碰到简繁混合的文件就会出错终止,而cconv就没有这样的缺点。
我照着iconv的Makefile写了一个,发现不能编译成功,是DB120或者HG255D或者AR71xx等mips平台的。请各位帮忙看看。
完美解决的,我将会转账2000M
源文件:cconv
http://haitao.8x6x.com:899/123/11292-zip.gif cconv-0.6.2.tar.zip (526 K) 下载次数:0
软件主页:http://code.google.com/p/cconv/
Makefile ,我照着iconv改的,可能不正确,请大家一起指正

复制代码
# Copyright (C) 2012 OpenWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=cconv
PKG_VERSION:=0.6.2
PKG_RELEASE:=1
PKG_REV:=$(PKG_VERSION)

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://cconv.googlecode.com/files/

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/cconv
DEPENDS:=+libiconv-full +libcharset
SECTION:=utils
CATEGORY:=Utilities
TITLE:=CCONV CHINESE
URL:=http://code.google.com/p/cconv
endef

define Package/dnscrypt-proxy/description
      Conver CHT to CHS
endef

define Build/Configure
      $(call Build/Configure/Default, \
                --prefix=/usr \
      )
endef

TARGET_CFLAGS += $(FPIC) -DUSE_DOS

define Build/Compile
      $(MAKE) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                install
endef

define Package/cconv/install
      $(INSTALL_DIR) $(1)/usr/bin
      $(CP) $(PKG_INSTALL_DIR)/usr/bin/cconv $(1)/usr/bin/
endef

$(eval $(call BuildPackage,cconv))
出错信息:

复制代码
cconv-cconv.o: In function `cconv':
cconv.c:(.text+0x8cc): undefined reference to `iconv'
cconv.c:(.text+0x8e8): undefined reference to `iconv'
cconv.c:(.text+0x974): undefined reference to `iconv'
cconv.c:(.text+0x990): undefined reference to `iconv'
cconv.c:(.text+0xb3c): undefined reference to `iconv'
cconv-cconv.o:cconv.c:(.text+0xb58): more undefined references to `iconv' follow
cconv-cconv.o: In function `cconv_close':
cconv.c:(.text+0xd1c): undefined reference to `iconv_close'
cconv.c:(.text+0xd20): undefined reference to `iconv_close'
cconv.c:(.text+0xd40): undefined reference to `iconv_close'
cconv.c:(.text+0xd44): undefined reference to `iconv_close'
cconv.c:(.text+0xd64): undefined reference to `iconv_close'
cconv-cconv.o:cconv.c:(.text+0xd68): more undefined references to `iconv_close' follow
cconv-cconv.o: In function `cconv_open':
cconv.c:(.text+0xed8): undefined reference to `iconv_open'
cconv.c:(.text+0xedc): undefined reference to `iconv_open'
cconv.c:(.text+0xfa8): undefined reference to `iconv_open'
cconv.c:(.text+0xfb8): undefined reference to `iconv_open'
cconv.c:(.text+0x1174): undefined reference to `iconv_open'
cconv-cconv.o:cconv.c:(.text+0x1184): more undefined references to `iconv_open' follow
collect2: ld returned 1 exit status
make: *** Error 1
make: Leaving directory `/media/hg255d/0829aa/build_dir/target-mips_uClibc-0.9.33.2/cconv-0.6.2'
make: *** Error 2
make: Leaving directory `/media/hg255d/0829aa/feeds/packages/utils/cconv'
make: *** Error 2
make: Leaving directory `/media/hg255d/0829aa'
make: *** 错误 2





q4ezq78l 发表于 2016-3-28 14:47:28



这个估计要上恩山/中国无线门户/OpenWrt中文网或者其它国际OpenWrt技术网站/论坛人更多...

fzr9uh 发表于 2016-3-28 14:47:28



回复本帖的M币多谢哦。

v0m4hh 发表于 2016-3-28 14:47:28


本帖最近评分记录:共条评分


回复 举报



在线n87735561

http://haitao.8x6x.com:899/123/19081-certificate.gif

http://haitao.8x6x.com:899/123/29291-none.gif
UID:1280127

http://haitao.8x6x.com:899/123/19518-mobile.gif注册时间2012-10-13 最后登录2016-03-28 在线时间3386小时 发帖57378 搜Ta的帖子 精华0 M币12925专家13 访问TA的空间加好友用道具
http://haitao.8x6x.com:899/123/29291-none.gif
数码肆段
http://haitao.8x6x.com:899/123/26393-11.gif

http://haitao.8x6x.com:899/123/2525-shequjumin.png
http://haitao.8x6x.com:899/123/28825-rexinhuiyuan.png
http://haitao.8x6x.com:899/123/7038-zuiaishafa.png
http://haitao.8x6x.com:899/123/2262-guanshuidashi.png
http://haitao.8x6x.com:899/123/18591-shequlaomo.png

发帖57378M币12925专家13粉丝113加关注 发消息 只看该作者 2楼 发表于: 2014-07-21
回帖奖励+ 1
热心助人奖励:+1 M币


不懂这个帮顶了

6bpkw9 发表于 2016-3-28 14:47:29



直接用源码里的configure改host改target生成的makefile可以编译得到执行文件吗,按照它的提示好像是缺了iconv的库,你试试把出错的地方拉上去看看有没有说缺了头文件的,如果是缺了库的一般是找不到头文件的,缺了的要用源码编译库哦,不是linux上装哦

5lq1zr 发表于 2016-3-28 14:47:29



不懂,帮顶啦。

23z0mcko 发表于 2016-3-28 14:47:29



不懂Makefile的路过。。。。

ie9wczh 发表于 2016-3-28 14:47:29



楼下懂得说说。


6zd000m 发表于 2016-3-28 14:47:30


本帖最近评分记录:共条评分


明艳不可方物!魅色手电精灵,最短小便携的不锈钢18650小直!(支持M币换购)回复 举报



离线qhw2012

http://haitao.8x6x.com:899/123/27695-930874.jpg
UID:930874注册时间2011-10-05 最后登录2016-03-26 在线时间155小时 发帖67 搜Ta的帖子 精华0 M币221专家1 访问TA的空间加好友用道具
http://haitao.8x6x.com:899/123/27695-930874.jpg
数码5级
http://haitao.8x6x.com:899/123/21921-2.gif
发帖67M币221专家1粉丝9加关注 发消息 只看该作者 1楼 发表于: 2014-08-04

最佳答案奖励:+100 M币


修改Makefile中依赖关系:
DEPENDS:=+libiconv
此外,还要修改cconv源码config.h.in:
注释掉/* #undef malloc */

最后,我交叉编译好了cconv
你试一下!
useage:分别copy sbin/cconv、lib/libiconv.so.2到openwrt sbin、lib目录
运行cconv

http://haitao.8x6x.com:899/123/11292-zip.gif cconv.7z (605 K) 下载次数:1

dren8jj 发表于 2016-3-28 14:47:30



进来看一看不懂。

页: [1]
查看完整版本: 移植cconv到openwrt出错,恳请各位编译大神支招“undefined reference to”