资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Thrift第一课源码编译

1)字符编码

为颍泉等地区用户提供了全套网页设计制作服务,及颍泉网站建设行业解决方案。主营业务为成都做网站、成都网站建设、颍泉网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

Thrift采用多字节的编码方式,在使用log4cplus进行日志管理的时候,同样需要编译一个多字节的字符编码的版本,否则就会出现log4cplus中无法解析的函数符号

 

2)Boost链接动态库

libthrift

要求boost库的智能指针,线程库以及librt

注意:bool interruptible_wait(detail::win32::handle handle_to_wait_for,detail::timeout target_time)怀疑是boost版本之间的问题,主要是原本采用了1.58.0版本,后来使用了1.64.0版本的代码,初步认为是两者之间的线程代码出现了分歧,导致无法找到函数的定义,实际上并没有出现这种情况目前采用的boost库是动态编译出来的,因此必须指定正确的运行时库,否则就会编译出错,调用boost的动态库,需要注释掉上面的两行代码,但是在目前来看依旧出现依赖libboost_thread-vc140-mt-sgd-1_64.lib不过从这里其实已经可以看出,调用的确实是静态库,其中有s,gd代表的意思是调试,mt代表多线程,

因此链接到boost静态库,说明运行时库指定的不正确,应该指定MDT

详细的资料参考如下;

http://www.cnblogs.com/bluedoctor/p/6236905.html

http://blog.csdn.net/xucuiping_/article/details/5979532

In the project properties you must also set HAVE_CONFIG_H 

as force include the config header: "windows/confg.h"

By default lib/cpp/windows/force_inc.h defines:

#define BOOST_ALL_NO_LIB 1

#define BOOST_THREAD_NO_LIB 1

This has for effect to have the host application linking against Thrift to have to link with boost thread as a static library. If you wanted instead to link with boost thread 

as a shared library,you'll need to uncomment those two lines, and recompile.

3)libthriftnb

依赖libevent,因此需要链接libevent

 

 

从目前的情况下看,只能够编译出静态库版本的thrift,预示着整一个工程只能够链接静态库

Depending upon whether you are linkingdynamically or statically and how

your build environment it set up,

you may need to include additional

libraries when linking against thrift,

such as librt and/or libpthread. If

you are using libthriftnb you will alsoneed libevent.

 

http://blog.csdn.net/zengraoli/article/details/51320593

 

究竟在什么地方会使用到openssl

在编译对应的lib文件时,并不需要引入openssl,仅当调用使用thrift的时候,加入了头文件TServerTransport.h才需要到openssl

 

 

参考

http://blog.csdn.net/kuenking111/article/details/47701847


分享文章:Thrift第一课源码编译
当前链接:http://www.cdkjz.cn/article/piodho.html
十二年 建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220