'undefined reference to `__ctype_tolower' 或 '__ctype_b'

来源:互联网 发布:php个人简历 编辑:程序博客网 时间:2024/06/05 16:24
转自:http://zhidao.baidu.com/question/29478934.html
'undefined reference to `__ctype_tolower' 或 '__ctype_b'
用make编译一个open client程序时(rh9+sybase12.5),出现错误:/home/sybase/OCS-12_5/lib/libsybdb.a(dbcursut.o)(.text+0xc7): In function `db__crs_search_phrase': : undefined reference to `__ctype_tolower' /home/sybase/OCS-12_5/lib/libsybdb.a(dbcursut.o)(.text+0x133): In function `db__crs_search_phrase': : undefined reference to `__ctype_tolower' /home/sybase/OCS-12_5/lib/libsybdb.a(intslist.o)(.text+0x38a): In function `intl__strblist': : undefined reference to `__ctype_b'
在网上搜了些这方面的资料,有的说是linux系统内核和sybase版本的冲突,说是gcc2.**之前的版本可以,gcc3.**就会出现这样的错误,但查看了编译器是gcc2.96的,如何解决呢?看到一帖:创建linuxpatch.c源文件#include <ctype.h>__const unsigned short int *__ctype_b;__const __int32_t *__ctype_tolower;__const __int32_t *__ctype_toupper;void ctSetup(){__ctype_b = *(__ctype_b_loc());__ctype_toupper = *(__ctype_toupper_loc());__ctype_tolower = *(__ctype_tolower_loc());}并在.c源程序中包含,并在main()中执行按照这个加入了__ctype_b 部分,重新编译果然好使。源帖出处:http://blog.chinaunix.net/u/28736/showart.php?id=240409
参考资料:http://blog.chinaunix.net/u/28736/showart.php?id=240409
我出现的问题是:配置eybuild的时候。由于需要安装ARM版的eybuild。但是在我安装好了之后。编译出现了上述错误。解决方法也是用的上面的。确实不错。
原创粉丝点击