gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.52k stars 2.02k forks source link

Ch3 visuallizeGeometry.cpp can't not work #193

Closed kgunt closed 3 years ago

kgunt commented 3 years ago

Hi Professor GAO , there has a problem for me . When I run this cpp file , it will give the following errors:

In file included from /usr/local/include/pangolin/utils/signal_slot.h:3:0, from /usr/local/include/pangolin/windowing/window.h:35, from /usr/local/include/pangolin/display/display.h:34, from /usr/local/include/pangolin/pangolin.h:38, from /home/nchu734/slambook2-master/ch3/visualizeGeometry/visualizeGeometry.cpp:11: /usr/local/include/signals/signals.hpp:257:17: error: parameter declared ‘auto’ template<auto PMF, class C> ^~~ /usr/local/include/signals/signals.hpp:269:17: error: parameter declared ‘auto’ template ^~~~ /usr/local/include/signals/signals.hpp: In member function ‘fteng::connection_raw fteng::signal<void(A ...)>::connect(C) const’: /usr/local/include/signals/signals.hpp:261:36: error: forming reference to void auto& call = calls.emplace_back(); ^ /usr/local/include/signals/signals.hpp: In lambda function: /usr/local/include/signals/signals.hpp:263:101: error: ‘PMF’ was not declared in this scope call.func = reinterpret_cast<void>(+[](void obj, A ... args) {((reinterpret_cast<C*>(obj))->PMF)(args...); }); ^~~ /usr/local/include/signals/signals.hpp: In member function ‘fteng::connection_raw fteng::signal<void(A ...)>::connect() const’: /usr/local/include/signals/signals.hpp:272:19: error: ‘func’ was not declared in this scope return connect(func); ^~~~ /usr/local/include/signals/signals.hpp:272:19: note: suggested alternative: ‘fputc’ return connect(func); ^~~~ fputc /usr/local/include/signals/signals.hpp: In member function ‘fteng::connection_raw fteng::signal<void(A ...)>::connect(void ()(A ...)) const’: /usr/local/include/signals/signals.hpp:278:36: error: forming reference to void auto& call = calls.emplace_back(); ^ /usr/local/include/signals/signals.hpp: In member function ‘fteng::connection_raw fteng::signal<void(A ...)>::connect(F&&) const’: /usr/local/include/signals/signals.hpp:288:24: error: ‘remove_pointer_t’ in namespace ‘std’ does not name a template type using f_type = std::remove_pointer_t<std::remove_reference_t>; ^~~~ /usr/local/include/signals/signals.hpp:289:23: error: ‘is_convertible_v’ is not a member of ‘std’ if constexpr (std::is_convertible_v<f_type, void()(A...)>) ^~~~ /usr/local/include/signals/signals.hpp:289:23: note: suggested alternative: ‘is_convertible’ if constexpr (std::is_convertible_v<f_type, void()(A...)>) ^~~~ is_convertible /usr/local/include/signals/signals.hpp:289:40: error: ‘f_type’ was not declared in this scope if constexpr (std::is_convertible_v<f_type, void()(A...)>) ^~ /usr/local/include/signals/signals.hpp:289:40: note: suggested alternative: ‘wctype’ if constexpr (std::is_convertible_v<f_type, void()(A...)>) ^~ wctype /usr/local/include/signals/signals.hpp:289:48: error: expected primary-expression before ‘void’ if constexpr (std::is_convertible_v<f_type, void()(A...)>) ^~~~ .

and so on.....

Can you tell me what is the reason of my problem?

By the way , the IDE that I use is Clion

rugbyheu commented 3 years ago

I meet the same problem, did you solve it ?

kgunt commented 3 years ago

I meet the same problem, did you solve it ?

You can try to change the codes in CMakeList .

Like this: set(CMAKE_CXX_FLAGS "-std=c++17")

The reason for this problem is because the C++ version is too old