stephanecharette / DarkHelp

C++ wrapper library for Darknet
https://www.ccoderun.ca/darkhelp/api/Summary.html
MIT License
146 stars 25 forks source link

make error in Linux #15

Closed lantudou closed 3 years ago

lantudou commented 3 years ago
Building ver: 1.3.11-1
-- Configuring done
-- Generating done
-- Build files have been written to: /share_data/YuhaoSun/DarkHelp-master/build
(yolox) root@test:/share_data/YuhaoSun/DarkHelp-master/build# make
Scanning dependencies of target dh
[ 16%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o
[ 33%] Linking CXX static library libdarkhelp.a
[ 33%] Built target dh
Scanning dependencies of target cli
[ 50%] Building CXX object src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:131:35: error: use of deleted function ‘std::atomic<bool>::atomic(const std::atomic<bool>&)’
 std::atomic<bool> signal_raised = false;
                                   ^
In file included from /share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:10:0:
/usr/include/c++/5/atomic:66:5: note: declared here
     atomic(const atomic&) = delete;
     ^
/usr/include/c++/5/atomic:70:15: note:   after user-defined conversion: constexpr std::atomic<bool>::atomic(bool)
     constexpr atomic(bool __i) noexcept : _M_base(__i) { }
               ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void show_help_window()’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:20: error: expected unqualified-id before ‘[’ token
  for (const auto & [key, val] : help)
                    ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:20: error: expected ‘;’ before ‘[’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:21: error: ‘key’ was not declared in this scope
  for (const auto & [key, val] : help)
                     ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:26: error: ‘val’ was not declared in this scope
  for (const auto & [key, val] : help)
                          ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In lambda function:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘{’ before ‘:’ token
  for (const auto & [key, val] : help)
                               ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void show_help_window()’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘;’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘)’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:215:13: error: unused variable ‘font_face’ [-Werror=unused-variable]
  const auto font_face  = cv::HersheyFonts::FONT_HERSHEY_SIMPLEX;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:216:13: error: unused variable ‘font_scale’ [-Werror=unused-variable]
  const auto font_scale  = 0.5;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:217:13: error: unused variable ‘font_thickness’ [-Werror=unused-variable]
  const auto font_thickness = 1;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:219:6: error: unused variable ‘y’ [-Werror=unused-variable]
  int y = 25;
      ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void init(Options&, int, char**)’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:21: error: expected unqualified-id before ‘[’ token
   for (const auto & [key, val] : debug_messages)
                     ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:21: error: expected ‘;’ before ‘[’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:22: error: ‘key’ was not declared in this scope
   for (const auto & [key, val] : debug_messages)
                      ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:27: error: ‘val’ was not declared in this scope
   for (const auto & [key, val] : debug_messages)
                           ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In lambda function:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘{’ before ‘:’ token
   for (const auto & [key, val] : debug_messages)
                                ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void init(Options&, int, char**)’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘;’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘)’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected primary-expression before ‘:’ token
cc1plus: all warnings being treated as errors
src-tool/CMakeFiles/cli.dir/build.make:82: recipe for target 'src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o' failed
make[2]: *** [src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o] Error 1
CMakeFiles/Makefile2:184: recipe for target 'src-tool/CMakeFiles/cli.dir/all' failed
make[1]: *** [src-tool/CMakeFiles/cli.dir/all] Error 2
Makefile:171: recipe for target 'all' failed
make: *** [all] Error 2
stephanecharette commented 3 years ago

What distro do you use, and what version?

lantudou commented 3 years ago

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)

Thanks for your reply

stephanecharette commented 3 years ago

I'm not surprised. You'll probably have to upgrade to something newer. That version is horribly out of date.

lantudou commented 3 years ago

By the way, I have a question about the relationship between your DarkMark and DarkHelp.

It seems that the DarkHelp could help you to infer using darknet model and DarkMark could help you to check the training data and configuration. Why DarkMark is still need to use DarkHelp as the installation dependency?

stephanecharette commented 3 years ago

I don't follow you. DarkMark is definitely not needed as a dependency to use DarkHelp. It is the other way around. DarkMark uses DarkHelp to do inference.

lantudou commented 3 years ago

I have updated the gcc to version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~16.04). there are still the same errors.

stephanecharette commented 3 years ago

You need a compiler that supports C++17. This builds correctly for me in Ubuntu 18.04 using gcc 7.5.0, and in Ubuntu 20.04 using gcc 9.3.0.

stephanecharette commented 3 years ago

I also just confirmed that it is building correctly in Windows using Visual Studio 2019.