Thrift编译错误('::malloc' has not been declared)
问题版本:0.9.0
make[4]: Entering directory `/tmp/X/thrift-0.9.0/lib/cpp'
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/thirdparty/boost/include -I./src -I./src/thrift -I/usr/local/thirdparty/openssl/include -Wall -g -O2 -MT Thrift.lo -MD -MP -MF .deps/Thrift.Tpo -c -o Thrift.lo `test
-f 'src/thrift/Thrift.cpp' || echo './'`src/thrift/Thrift.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/thirdparty/boost/include -I./src -I./src/thrift -I/usr/local/thirdparty/openssl/include -Wall -g -O2 -MT Thrift.lo -MD -MP -MF .deps/Thrift.Tpo -c src/thrift/Thrift.cpp -fPIC -DPIC -o .libs/Thrift.o
In file included from src/thrift/Thrift.cpp:22:
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstdlib:119: error:
'::malloc' has not been declared
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstdlib:127: error: '::realloc' has not been declared
src/thrift/Thrift.cpp: In member function 'void apache::thrift::TOutput::printf(const char*, ...)':
src/thrift/Thrift.cpp:46: error: 'malloc' was not declared in this scope
make[4]: *** [Thrift.lo] Error 1
解决方法:
在成功执行configure后(在未执行configure之前找不到下列两行),修改与configure同目录下的config.h文件,将文件中的如下两行注释掉:
#define malloc rpl_malloc
#define realloc rpl_realloc
附1:安装Thrift命令行:
./configure --prefix=/usr/local/thirdparty/thrift-0.9.0 --with-boost=/usr/local/thirdparty/boost --with-libevent=/usr/local/thirdparty/libevent CPPFLAGS="-I/usr/local/thirdparty/openssl/include" LDFLAGS="-ldl -L/usr/local/thirdparty/openssl/lib" --with-qt4=no
--with-c_glib=no --with-csharp=no --with-erlang=no --with-perl=no --with-ruby=no --with-haskell=no --with-go=no --with-d
当OpenSSL未以默认安装目录时,请注意上面的用法。
附2:相关博文:
(安装thrift时,注意openssl参数)http://blog.chinaunix.net/uid-20682147-id-3399150.html
如果在使用Thrift时,编译遇到类似“TTransport.h:107: error: 'uint32_t' does not name a type”的错误,只需要在Thrift.h文件中增加一行:#include <stdint.h>。
Thrift.h文件位于make install后的include目录下,如果不知道在哪,可以使用find命令查找。
Thrift编译错误('::malloc' has not been declared)的更多相关文章
- Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32'
Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32' 在编译Thrift的时候,无论是Apache官网tar包,还是Github ...
- 【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
[Redis]编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory 在安装redis进行编译 ...
- I.MX6 linux kernel编译错误处理
/******************************************************************************** * I.MX6 linux kern ...
- thrift编译java的问题-(安装thrift0.8.0成功-编译mapkeeper.java成功)
上一次帖子说了thrift编译java出现错误,由于只用到cpp版的,就将此略过.但是老版本的ycsb不是很好用,于是决定以locall的方式编译mapkeeper供最新版ycsb使用.目前根据 ht ...
- xamarin.forms新建项目android编译错误
vs2015 update3 新建的xamarin.forms项目中的android项目编译错误.提示缺少android_m2repository_r22.zip,96659D653BDE0FAEDB ...
- 《转载》使用org.w3c.dom.Element的setTextContent()、getTextContent()方法时出现编译错误
今天在更新项目后进行编译时,出现如下错误一堆: 编译错误 Google之,在stackoverflow上看到如下的解决方法: I came here with the same problem. Ev ...
- asp.net教程:编译错误同时存在于不同dll中
asp.net 编译错误类型“同时存在于”不同的dll中. 出现这种错误大概有三种情况: 1.ASPX页面,一个*.ASPX,对应着一个*.cs文件,两者其实是一个文件,通过两者实现代码分离,每个*. ...
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
VS2010出现FileTracker : error FTK1011不知道是不是vs2010的一个bug,反正有人提交了. FileTracker : error FTK1011编译错误的解决办法有 ...
- PowerDesginer 生成的Oracle 11g 组合触发器代码编译错误(29): PLS-00103
问题描述: 采用PowerDesigner15针对Oracle 11g 创建物理数据模型,想实现一个字段的自增,采用如下步骤: 1.创建序列,命名为Sequence_1; 2.在自增字段编辑窗口中,选 ...
随机推荐
- django创建第一个项目helloworld
环境:centos 7,已安装python 3.6环境 1.安装django并创建django第一个项目 1.1.使用pip安装django# pip install Django或指定安装版本# p ...
- unity的prefab(预设)例子
prefab用于预先设置一些控件,在需要的时候直接引用,简化开发,当然,你完全可以用写代码解决 在场景内新建一个空物体,绑定一个脚本 void Start () { GameObject cube = ...
- 黄聪:360浏览器、chrome开发扩展插件教程(3)关于本地存储数据
转载:http://www.cnblogs.com/walkingp/archive/2011/04/04/2003875.html HTML5中的localStorage localStorage与 ...
- 使用css弹性盒子模型
提示: 当期内容不充实, 修改后再来看吧 以下称:弹性子元素: 子元素, 弹性容器: 容器 弹性盒子的属性 1. css弹性盒子模型规定了弹性元素如何在弹性容器内展示 2. 弹性元素默认显示在弹性容器 ...
- CVE-2018-8420 漏洞复现
影响的 Windows 版本: Microsoft Windows 10 Version 1607 for 32-bit SystemsMicrosoft Windows 10 Version 160 ...
- Centos 7.2基础安装和配置(含分区方案建议)
景:windows桌面运维为主的我,前几天接到一个去某客户上架安装服务器的工作任务,含糊的说要上架几台服务器顺便安装Centos系统,于是我便下载了一个Centos7.2版本的镜像,顺利的用USBwr ...
- Yii中利用filters来控制访问
filters()方法定义在CController里,用Gii生成Controller时里面就有filters方法,代码如下: public function filters() { // retur ...
- Maven(四-1) Maven的配置文件settings.xml
转载于:http://www.cnblogs.com/yakov/archive/2011/11/26/maven2_settings.html 概览 当Maven运行过程中的各种配置,例如pom.x ...
- Cloudera Manger CDH 安装文档
简介: Cloudera Manager 是 Cloudera 公司推出的 Hadoop 集群管理工具,通过该管理工具可以方便的部署.配置.监控集群. Cloudera 公司自己发布的 Hadoop ...
- 图片上传jQuery插件(兼容IE8)
图片上传jQuery插件(兼容IE8) 代码来源 :https://github.com/zilan93/uploadImg html <!DOCTYPE html> <ht ...