Cannot build
Hi,
Trying to bulid the dbc lib but it fails on make, any idea on this?
[z8dennis.delin@segot-s257]~/toby/vector_dbc/build% cmake ..
-- Could NOT find Graphviz_dot (missing: GRAPHVIZ_DOT_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/local/AUTO/z8dennis.delin/toby/vector_dbc/build
[z8dennis.delin@segot-s257]~/toby/vector_dbc/build% make
[ 5%] Building CXX object src/Vector/DBC/CMakeFiles/Vector_DBC.dir/Attribute.cpp.o
In file included from /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/Attribute.h:28:0,
from /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/Attribute.cpp:22:
/home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/AttributeValueType.h:34:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11 [enabled by default]
enum class AttributeValueType {
^
/home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/Attribute.cpp: In constructor ‘Vector::DBC::Attribute::Attribute()’:
/home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/Attribute.cpp:29:15: error: ‘AttributeValueType’ is not a class or namespace
valueType(AttributeValueType::Int),
^
make[2]: *** [src/Vector/DBC/CMakeFiles/Vector_DBC.dir/Attribute.cpp.o] Error 1
make[1]: *** [src/Vector/DBC/CMakeFiles/Vector_DBC.dir/all] Error 2
make: *** [all] Error 2
Comments (11)
-
-
repo owner There is at least an error in the CMakeLists.txt file in the activation of C++11 standard: CXX_STANDARD_REQUIRED 11. I fixed this in my project template already, but haven't updated Vector_DBC with this template yet. This leads to the "warning: scoped enums". I'll fix this today.
Likely this also solves the error. As warnings are made to errors in the platform.h.
-
repo owner - changed status to resolved
Update project template. Change includes to use <>.
- Update to latest project template to fix C++11 settings.
- Change includes from "" to <>.
Fixes
#3Signed-off-by: Tobias Lorenz tobias.lorenz@gmx.net
→ <<cset ee90c30c8f78>>
-
repo owner The issue should be solved now by fixing the C++11 settings in CMakeLists.txt. Please give it a try. If problem still remains on your side, we'll reopen the issue.
-
Thank you, That issue was solved but still have some compiler issue now at FileLoad.
[ 47%] Building CXX object src/Vector/DBC/CMakeFiles/Vector_DBC.dir/FileLoad.cpp.o /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp: In member function ‘void Vector::DBC::File::chomp(std::string&)’: /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:100:58: error: no matching function for call to ‘regex_replace(std::string&, std::regex, const char [1])’ line = regex_replace(line, regex("[[:space:]]+$"), ""); ^ /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:100:58: note: candidates are: In file included from /usr/include/c++/4.8.2/regex:62:0, from /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:31: /usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template<class _Out_iter, class _Bi_iter, class _Rx_traits, class _Ch_type> _Out_iter std::regex_replace(_Out_iter, _Bi_iter, _Bi_iter, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type) regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last, ^ /usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template argument deduction/substitution failed: /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:100:58: note: deduced conflicting types for parameter ‘_Bi_iter’ (‘std::basic_regex<char>’ and ‘const char*’) line = regex_replace(line, regex("[[:space:]]+$"), ""); ^ In file included from /usr/include/c++/4.8.2/regex:62:0, from /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:31: /usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template<class _Rx_traits, class _Ch_type> std::basic_string<_Ch_type> std::regex_replace(const std::basic_string<_Ch_type>&, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type) regex_replace(const basic_string<_Ch_type>& __s, ^ /usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template argument deduction/substitution failed: /home/local/AUTO/z8dennis.delin/toby/vector_dbc/src/Vector/DBC/FileLoad.cpp:100:58: note: mismatched types ‘const std::basic_string<_Ch_type>’ and ‘const char [1]’ line = regex_replace(line, regex("[[:space:]]+$"), ""); ^ make[2]: *** [src/Vector/DBC/CMakeFiles/Vector_DBC.dir/FileLoad.cpp.o] Error 1 make[1]: *** [src/Vector/DBC/CMakeFiles/Vector_DBC.dir/all] Error 2 make: *** [all] Error 2
-
repo owner What OS are you using? What compiler are you using? I'll try to install the same environment here. Have you selected std::regex or boost::regex?
-
Running linux redhat. Compiler c++ NU 4.8.5. I've tested with std::regex and boost::regex ( boost-devel.x86_64 0:1.53.0-27.el7 ) but same result. cmake version 3.10.0-rc3
Btw. awesome libraries so far!
-
I just saw that you need gcc > 4.9 Could this be the reason. If that the case I will try to install a build env on a virtual machine for compile.
-
repo owner I used gcc-4.8.4 from Debian testing, when I developed the software. I found that it didn't support std::regex sufficiently, hence the possibility to use boost::regex instead. Since gcc-4.9 the std::regex works.
Likely this new issue "error: no matching function for call" is caused by RedHat's gcc-4.8 compilers. 1. I found a similar discussions/issues with char vs. std::string conversion, e.g. here: https://github.com/eteran/edb-debugger/issues/272 2. The C++11 standard should provide a std::regex_replace with types "(std::string, std::regex, const char)" that gcc complains about. See Variant 4 in http://en.cppreference.com/w/cpp/regex/regex_replace.
Yes, please give it a try with a gcc >= 4.9. I still need to decide then, if I should change the source codes to support RedHat's gcc-4.8 compiler anyway...
Btw. awesome libraries so far! Thanks. Makes me happy to get this feedback. :-)
-
Worked just fine on my ubuntu VM with gcc 4.9
-
repo owner Good, then I keep this ticket closed. Thanks for the feedback :-)
- Log in to comment
Forgot to login..