sylar-yin / sylar

C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)

Home Page:http://www.sylar.top

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

编译该库时失败

angelbeibei opened this issue · comments

您好,我已经按照您的安装环境的要求进行了环境的配置,并且在配置环境过程中都成功了,十分顺利,但在下载该库进行编译,make时,报了如下的错误:
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at thirdpart/yaml-cpp/CMakeLists.txt:9 (cmake_policy):
The OLD behavior for policy CMP0012 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

CMake Deprecation Warning at thirdpart/yaml-cpp/CMakeLists.txt:13 (cmake_policy):
The OLD behavior for policy CMP0015 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

-- Performing Test FLAG_WEXTRA
-- Performing Test FLAG_WEXTRA - Success
-- JsonCpp Version: 1.8.4
-- Looking for C++ include clocale
-- Looking for C++ include clocale - found
-- Looking for localeconv
-- Looking for localeconv - found
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of lconv
-- Check size of lconv - done
-- Performing Test HAVE_DECIMAL_POINT
-- Performing Test HAVE_DECIMAL_POINT - Success
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.5", minimum required is "2.6")
-- Boost version: 1.53.0
CMake Error at /apps/sylar/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
/apps/sylar/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/apps/sylar/share/cmake-3.14/Modules/FindProtobuf.cmake:594 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/fight/workspace/sylar/build/CMakeFiles/CMakeOutput.log".
See also "/home/fight/workspace/sylar/build/CMakeFiles/CMakeError.log".
make: *** [xx] 错误 1

你能帮我解答一下么,我google了好久也一直没有解决,我也通过yum install 了protobuf,还是没有解决。谢谢

commented

你先尝试 sudo yum install protobuf-devel,然后在编译试试
这个提交里面尝试加入protobuf的支持,目前还没有实际使用上。
环境配置里面,后续会更新的。

@sylar-yin 谢谢,之前我用的是Cmake-3.14 后来我换成了cmake-3.15 ,source了一下,可以了。
但我现在遇到了另外一个问题,我在make编译这个框架时,只生成了部分的二进制文件
➜ sylar git:(master) ✗ bin/
conf/ sylar* * test_sqlite3*
没有生成所有的,但在make -j时build了所有,比如Building CXX object CMakeFiles/test_crypto.dir/tests/test_crypto.cc.o
但没有对 build进行link,我也想通过bin/test_http_server进行测试,但没有生成那个二进制文件,我重复编译了几次都没有成功。

commented

CMakeLists.txt 设置了条件编译,测试的代码默认不开启编译(为了节省编译时间)
你可以修改 CmakeLists.txt 把 option(TEST "ON for complile test" OFF) 修改成 option(TEST "ON for complile test" ON) 重新编译,应该就可以了