danomatika / ofxMidi

(maintained) Midi addon for openFrameworks
Other
262 stars 72 forks source link

Error trying to pass by reference ofxMidiListener #39

Closed flyingrub closed 8 years ago

flyingrub commented 8 years ago
0 fly@Minotoor ~/workspace/openFrameworks/apps/myApps/Alea $ make
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
Compiling OF library for Release
make[1]: Entering directory '/home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/project'
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
Done!
make[1]: Leaving directory '/home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/project'

Compiling Alea for Release
make[1]: Entering directory '/home/fly/workspace/openFrameworks/apps/myApps/Alea'
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
Compiling /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp
g++ -c -O3 -DNDEBUG -march=native -mtune=native -Wall -std=c++14 -DGCC_HAS_REGEX -DOF_USING_GTK -DOF_USING_GTK -DOF_USING_MPG123  -D_REENTRANT -pthread -I/usr/include/gstreamer-1.0 -I/usr/lib/gstreamer-1.0/include -I/usr/include/AL -I/usr/include/alsa -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I../../../libs/fmodex/include -I../../../libs/glfw/include -I../../../libs/glfw/include/GLFW -I../../../libs/kiss/include -I../../../libs/poco/include -I../../../libs/tess2/include -I../../../libs/utf8cpp/include -I../../../libs/utf8cpp/include/utf8 -I../../../libs/openFrameworks -I../../../libs/openFrameworks/utils -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/sound -I/home/fly/workspace/openFrameworks/apps/myApps/Alea/src -I/home/fly/workspace/openFrameworks/addons/ofxPostProcessing/src -I/home/fly/workspace/openFrameworks/addons/ofxMidi/src -I/home/fly/workspace/openFrameworks/addons/ofxMidi/src/desktop -I/home/fly/workspace/openFrameworks/addons/ofxMidi/src/ios -I/home/fly/workspace/openFrameworks/addons/ofxMidi/libs -I/home/fly/workspace/openFrameworks/addons/ofxMidi/libs/rtmidi -I/home/fly/workspace/openFrameworks/addons/ofxMidi/libs/pgmidi -MMD -MP -MF obj/linux64/Release/src/Alea.d -MT obj/linux64/Release/src/Alea.o -o obj/linux64/Release/src/Alea.o -c /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp
/home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp: In member function ‘void Alea::setup(Audio, Midi)’:
/home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp:9:7: error: use of deleted function ‘Midi& Midi::operator=(const Midi&)’
  midi = m;
       ^
In file included from /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.h:4:0,
                 from /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp:1:
/home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Midi.h:4:7: note: ‘Midi& Midi::operator=(const Midi&)’ is implicitly deleted because the default definition would be ill-formed:
 class Midi : public ofxMidiListener {
       ^
/home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Midi.h:4:7: error: use of deleted function ‘std::basic_stringstream<_CharT, _Traits, _Alloc>& std::basic_stringstream<_CharT, _Traits, _Alloc>::operator=(const std::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
In file included from ../../../libs/openFrameworks/utils/ofConstants.h:386:0,
                 from ../../../libs/openFrameworks/ofMain.h:5,
                 from /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.h:2,
                 from /home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp:1:
/usr/include/c++/5.2.0/sstream:731:7: note: declared here
       operator=(const basic_stringstream&) = delete;
       ^
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:199: recipe for target 'obj/linux64/Release/src/Alea.o' failed
make[1]: *** [obj/linux64/Release/src/Alea.o] Error 1
make[1]: Leaving directory '/home/fly/workspace/openFrameworks/apps/myApps/Alea'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2

i'm don't have a lot of experience with c++ perhaps i'm making a mistake somewhere.

danomatika commented 8 years ago

Would be helpful to see what's in the setup function. Judging from the error message, the problem is:

/home/fly/workspace/openFrameworks/apps/myApps/Alea/src/Alea.cpp:9:7: error: use of deleted function ‘Midi& Midi::operator=(const Midi&)’
  midi = m;
danomatika commented 8 years ago

Ah I see. You're using the = operator aka midi = m; except ofxMidi does not have that operator. Maybe you need to use a pointer or a reference?

flyingrub commented 8 years ago

yup, i use a pointer now. :) but i have another error comming form ofxMidi. https://gist.github.com/flyingrub/012441d8a4693aff15f6

danomatika commented 8 years ago

I don't see anything specific to ofxMidi. It looks more like you have an include path issue or are not linking those add ons correctly. I'd ask on the OF forums.

flyingrub commented 8 years ago

It doesn't seem related to ofxMidi, I reverted the commit and it still does the error. But it's weird as i didn't modified anything else...