Wednesday 15 May 2013

c++ - Error with unique_ptr on Oculus project -



c++ - Error with unique_ptr on Oculus project -

i working on oculus rift project (dk1) on ubuntu 14.04 , seek compile github projet. qt project written in c++. have next error "unique_ptr". think have installed right libraries. know code have worked on ubuntu computer.

g++ -c -m64 -pipe -ofast -wno-deprecated -o2 -std=c++0x -wall -w -fpie -i/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -i. -o camera.o camera.cpp in file included include/ovr/libovr/include/../src/ovr_device.h:33:0, include/ovr/libovr/include/ovr.h:35, oculus.h:13, input.h:13, camera.h:12, camera.cpp:1: include/ovr/libovr/include/../src/ovr_devicemessages.h: in constructor ‘ovr::messagecameraframe::messagecameraframe(ovr::devicebase*)’: include/ovr/libovr/include/../src/ovr_devicemessages.h:255:13: warning: ‘ovr::messagecameraframe::camerahandle’ initialized after [-wreorder] uint32* camerahandle; // identifies photographic camera object associated frame ^ include/ovr/libovr/include/../src/ovr_devicemessages.h:249:18: warning: ‘const ubyte* ovr::messagecameraframe::pframedata’ [-wreorder] const ubyte* pframedata; // ptr frame data. ^ include/ovr/libovr/include/../src/ovr_devicemessages.h:226:5: warning: when initialized here [-wreorder] messagecameraframe(devicebase* dev) ^ camera.cpp: in constructor ‘camera::camera(const vec3&, const vec3&, const vec3&, float, float, const input&)’: camera.cpp:20:18: error: utilize of deleted function ‘input::input(const input&)’ speed_ {speed} ^ in file included camera.h:12:0, camera.cpp:1: input.h:33:7: note: ‘input::input(const input&)’ implicitly deleted because default definition ill-formed: class input ^ input.h:33:7: error: utilize of deleted function ‘std::unique_ptr<_tp, _dp>::unique_ptr(const std::unique_ptr<_tp, _dp>&) [with _tp = genericoculus; _dp = std::default_delete<genericoculus>]’ in file included /usr/include/c++/4.8/memory:81:0, logcpp/log.h:8, oculus.h:23, input.h:13, camera.h:12, camera.cpp:1: /usr/include/c++/4.8/bits/unique_ptr.h:273:7: error: declared here unique_ptr(const unique_ptr&) = delete; ^ camera.cpp:20:18: warning: temporary bound ‘camera::input_’ persists until constructor exits [-wextra] speed_ {speed} ^ make: *** [camera.o] erreur 1

thank you

the problem here lies in message:

input.h:33:7: error: utilize of deleted function ‘std::unique_ptr<_tp, _dp>::unique_ptr(const std::unique_ptr<_tp, _dp>&)

you're apparently trying build unique_ptr unique_ptr. that's forbidden, unique_ptr can't copied (that's point of having unique pointer). can move unique_ptr transfer ownership.

so you'll have revise code info in mind.

note: apparently have fellow member unique_ptr in class, , re-create constructor deleted (i.e. explicitely forbidden), default re-create constructor of class deleted, explains next error message in stack:

camera.cpp:20:18: error: utilize of deleted function ‘input::input(const input&)

c++ unique-ptr oculus

No comments:

Post a Comment