Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译该库时失败 #1

Closed
angelbeibei opened this issue Jul 7, 2019 · 3 comments
Closed

编译该库时失败 #1

angelbeibei opened this issue Jul 7, 2019 · 3 comments

Comments

@angelbeibei
Copy link

您好,我已经按照您的安装环境的要求进行了环境的配置,并且在配置环境过程中都成功了,十分顺利,但在下载该库进行编译,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,还是没有解决。谢谢

@sylar-yin
Copy link
Owner

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

@angelbeibei
Copy link
Author

@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进行测试,但没有生成那个二进制文件,我重复编译了几次都没有成功。

@sylar-yin
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants