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

Failed in building ... #7

Open
wqw547243068 opened this issue Jan 19, 2022 · 1 comment
Open

Failed in building ... #7

wqw547243068 opened this issue Jan 19, 2022 · 1 comment

Comments

@wqw547243068
Copy link

编译失败

在centos、mac上分别按照readme步骤编译,都出错了;

  • 执行命令:cmake ..
  • 提示:没有找到main.cc
(base) [wangqiwen004@ build]$ cmake ..
-- 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
-- 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
-- Configuring done
CMake Error at CMakeLists.txt:30 (add_executable):
  Cannot find source file:

    main.cc

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

-- Build files have been written to: /home/wangqiwen004/work/cpp/TinyWeb/src/build
(base) [wangqiwen004@nlptest01-search build]$ make
make: *** No targets specified and no makefile found.  Stop.
@wqw547243068
Copy link
Author

wqw547243068 commented Jan 20, 2022

[Update]

发现test目录下有个类似main的文件,于是复制到根目录,再次cmake,成功

  • cp test/main_test.cc main.cc

然而,执行make时,再次出错

  • (1)mac环境:mba 2019版
    • 报错:./tiny_base/log.h:75:15: error: friend declaration specifying a default argument must be the only
      declaration。
      • 将友元函数声明里的字段默认赋值去掉后,问题解决,但新问题出来
    • 报错:./tiny_base/memorypool.h:19:10: fatal error: 'boost/function.hpp' file not found
      • 疑似缺少boost库?
  • (2)linux环境:centos
    • 报错:编译到98%时,故障,发现sem_*系列函数未定义
    • slave.cc:(.text+0x136): undefined reference to `WebProtocol::WebProtocol()'
    • semaphore.cc:(.text+0x3a): undefined reference to `sem_init'

诉求

  • 能否提供可运行的编译步骤?

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

1 participant