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

"make" encounter error #17

Open
luckypoem opened this issue Jul 26, 2019 · 4 comments
Open

"make" encounter error #17

luckypoem opened this issue Jul 26, 2019 · 4 comments

Comments

@luckypoem
Copy link

hi.

yudeMacBook-Air:build brite$ make
Scanning dependencies of target cdns
[ 11%] Building C object CMakeFiles/cdns.dir/main.c.o
/Users/yuming/cdns-by-semigodking/main.c:28:10: fatal error: 'argp.h' file not
found
#include <argp.h>
^
1 error generated.
make[2]: *** [CMakeFiles/cdns.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/cdns.dir/all] Error 2
make: *** [all] Error 2
yudeMacBook-Air:build brite$

how to fix it?
thank you

@semigodking
Copy link
Owner

As someone mentioned, it requires argp-standalone. I do not have MacOS for test.

@laggardkernel
Copy link

作了一个Homebrew Formula,自动安装依赖编译。laggardkernel/homebrew-tap

brew install laggardkernel/tap/cdns

目前编译出1.1版可用。

但是如果编译当前分支最新版--HEAD,编译是成功的,但是启动报错 cdns_init_server 什么什么。不知道后来的IPv6支持是不是不兼容macOS。

@semigodking
Copy link
Owner

具体错误信息是什么样子呢?

@laggardkernel
Copy link

laggardkernel commented Oct 28, 2019

❯ cdns -c /usr/local/etc/cdns/config.json
1572269801.422899 /tmp/cdns-20191028-39793-1jebj82/cdns.c:883 cdns_init_server(...) bind: Invalid argument

@semigodking 错误输出就这么一句话,我也搞不明白。

编译时候安装了 argp-standalone 作为依赖,注释掉了 blacklist.ctdestroy,添加了 CFLAGS -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp,编译使用了 cmake。同样条件编译1.1发布版是成功的。

以防万一,我把一些日志贴出来。

编译日志
==> cmake -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/cdns/HEAD-1c3dce7 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev ..
-- The C compiler identification is AppleClang 10.0.0.10001044
-- Check for working C compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang
-- Check for working C compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_FLAGS_RELEASE


-- Build files have been written to: /tmp/cdns-20191028-39793-1jebj82/build

==> make install PREFIX=/usr/local/Cellar/cdns/HEAD-1c3dce7
/usr/local/Cellar/cmake/3.15.4/bin/cmake -S/tmp/cdns-20191028-39793-1jebj82 -B/tmp/cdns-20191028-39793-1jebj82/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.15.4/bin/cmake -E cmake_progress_start /tmp/cdns-20191028-39793-1jebj82/build/CMakeFiles /tmp/cdns-20191028-39793-1jebj82/build/CMakeFiles/progress.marks
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 all
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cdns.dir/build.make CMakeFiles/cdns.dir/depend
cd /tmp/cdns-20191028-39793-1jebj82/build && /usr/local/Cellar/cmake/3.15.4/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/cdns-20191028-39793-1jebj82 /tmp/cdns-20191028-39793-1jebj82 /tmp/cdns-20191028-39793-1jebj82/build /tmp/cdns-20191028-39793-1jebj82/build /tmp/cdns-20191028-39793-1jebj82/build/CMakeFiles/cdns.dir/DependInfo.cmake --color=
Scanning dependencies of target cdns
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cdns.dir/build.make CMakeFiles/cdns.dir/build
[ 11%] Building C object CMakeFiles/cdns.dir/log.c.o
[ 33%] Building C object CMakeFiles/cdns.dir/main.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/log.c.o   -c /tmp/cdns-20191028-39793-1jebj82/log.c
[ 33%] Building C object CMakeFiles/cdns.dir/cfg.c.o
[ 44%] Building C object CMakeFiles/cdns.dir/json.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/cfg.c.o   -c /tmp/cdns-20191028-39793-1jebj82/cfg.c
[ 66%] Building C object CMakeFiles/cdns.dir/cdns.c.o
[ 66%] Building C object CMakeFiles/cdns.dir/blacklist.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/json.c.o   -c /tmp/cdns-20191028-39793-1jebj82/json.c
[ 77%] Building C object CMakeFiles/cdns.dir/dns.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/blacklist.c.o   -c /tmp/cdns-20191028-39793-1jebj82/blacklist.c
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/dns.c.o   -c /tmp/cdns-20191028-39793-1jebj82/dns.c
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/cdns.c.o   -c /tmp/cdns-20191028-39793-1jebj82/cdns.c
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/main.c.o   -c /tmp/cdns-20191028-39793-1jebj82/main.c
[ 88%] Building C object CMakeFiles/cdns.dir/util.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang  -I/tmp/cdns-20191028-39793-1jebj82/build  -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG   -std=gnu99 -o CMakeFiles/cdns.dir/util.c.o   -c /tmp/cdns-20191028-39793-1jebj82/util.c
[100%] Linking C executable cdns
/usr/local/Cellar/cmake/3.15.4/bin/cmake -E cmake_link_script CMakeFiles/cdns.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -I/usr/local/include -L/usr/local/lib -I/usr/include/machine -largp -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cdns.dir/main.c.o CMakeFiles/cdns.dir/log.c.o CMakeFiles/cdns.dir/json.c.o CMakeFiles/cdns.dir/cfg.c.o CMakeFiles/cdns.dir/cdns.c.o CMakeFiles/cdns.dir/dns.c.o CMakeFiles/cdns.dir/blacklist.c.o CMakeFiles/cdns.dir/util.c.o  -o cdns -levent -lm
[100%] Built target cdns
/usr/local/Cellar/cmake/3.15.4/bin/cmake -E cmake_progress_start /tmp/cdns-20191028-39793-1jebj82/build/CMakeFiles 0
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 preinstall
make[1]: Nothing to be done for `preinstall'.
Install the project...
/usr/local/Cellar/cmake/3.15.4/bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /usr/local/Cellar/cdns/HEAD-1c3dce7/bin/cdns

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

3 participants