The previous text has already described thrift-client. Here we will briefly write the MAKEFILE file.
1. Write makefile as follows:
Src = $ (wildcard \
./*. Cpp \
../Gen-CPP/*. cpp \
)
Cc = g ++
Relflags =-O2-G
Thriftflags =-dhave_netinet_in_h-dhave_inttypes_h
Cflags =-I./-I ../Gen-CPP/-I/usr/local/include
Exec =./bin/main
Ldflags =-L./usr/local/lib
Libs =-lboost_thread-lboost_system-lthrift-lthritnb-lthriftz-LZ-lpthread-LRT-LDL
Rel_objs =$ (SRC: %. cpp = %. O)
Rel: $ (rel_objs)
$ (CC) $ (ldflags) $ (relflags) $ ^ $ (libs)-o $ (EXEC)
%. O: %. cpp
$ (CC)-C $ (cflags) $ (relflags) $ (thriftflags) $ <-o $ @
Clean:
Rm-RF $ (rel_objs) $ (EXEC)
Reprinted please indicate the source: zhujian blog, http://blog.csdn.net/linyanwen99/article/details/8510525
2. Running result:
Thrift-client:
Thrift-Server:
Reference text: Liu Da, http://my.csdn.net/Poechant
Reprinted please indicate the source: zhujian blog, http://blog.csdn.net/linyanwen99/article/details/8510525