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

missing --std=c++11 in CMakeLists.txt ? #578

Closed
diogodcarvalho opened this issue Feb 18, 2019 · 1 comment
Closed

missing --std=c++11 in CMakeLists.txt ? #578

diogodcarvalho opened this issue Feb 18, 2019 · 1 comment
Milestone

Comments

@diogodcarvalho
Copy link

I was not being able to compile the current branch of the repository due to errors related to std::unique_ptr definition not being found. The following errors appeared

In file included from /home/ubuntu/OpenNI2/libfreenect/wrappers/cpp/cppview.cpp:27:0:
/home/ubuntu/OpenNI2/libfreenect/wrappers/cpp/libfreenect.hpp:182:3: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
std::unique_ptr<uint8_t[]> m_rgb_buffer;
^
/home/ubuntu/OpenNI2/libfreenect/wrappers/cpp/libfreenect.hpp: In member function ‘void Freenect::FreenectDevice::setVideoFormat(freenect_video_format, freenect_resolution)’:
/home/ubuntu/OpenNI2/libfreenect/wrappers/cpp/libfreenect.hpp:115:5: error: ‘m_rgb_buffer’ was not declared in this scope
m_rgb_buffer.reset(new uint8_t[mode.bytes]);

I solved the issue by adding the c++11 flag in CMakeLists line 117
set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS_DEFAULT} ${CMAKE_CXX_FLAGS} --std=c++11")

Shouldn't this be changed in the repository? Other people already had this error (see #576) but they ended up only using older versions

@piedar piedar added this to the v0.6.0 milestone Feb 18, 2019
@piedar piedar closed this as completed in 3516072 Feb 24, 2019
@xinkai-jiang
Copy link

Thank you and it works

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