Ubuntu 9.04: having a hard time setting up

Ubuntu 9.04 32bit.

I download the regular codeblocks package.

I run ubuntu/install_codeblocks.sh – it fails because of some servers being down or something. No problem, since I have codeblocks installed already. I run install_prerequisites.sh and it works just fine and installs stuff.

Then I can get a project running. but when I try to make that file, I get

  
../../../libs/openFrameworks/video/ofUCUtils.cpp:19:22: warning: avformat.h: No such file or directory  
../../../libs/openFrameworks/video/ofUCUtils.cpp:20:21: warning: swscale.h: No such file or directory  
../../../libs/openFrameworks/video/ofUCUtils.cpp: In member function ‘void ofUCUtils::set_format(int, int)’:  
../../../libs/openFrameworks/video/ofUCUtils.cpp:303: error: invalid conversion from ‘int’ to ‘PixelFormat’  
../../../libs/openFrameworks/video/ofUCUtils.cpp:303: error:   initializing argument 3 of ‘SwsContext* sws_getContext(int, int, PixelFormat, int, int, PixelFormat, int, SwsFilter*, SwsFilter*, double*)’  
make: *** [obj/Debug/libs/openframeworks/video/ofUCUtils.o] Error 1  
  

so I’m like alright, let me try to compile this in code::blocks. I work around a few kinks, but then I get to:

  
  
  
-------------- Build: Debug in foundation ---------------  
  
Compiling: src/testApp.cpp  
In file included from /usr/include/gstreamer-0.10/gst/gstelement.h:51,  
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,  
                 from /usr/include/gstreamer-0.10/gst/gst.h:34,  
                 from ../../../libs/openFrameworks/video/ofVideoPlayer.h:9,  
                 from ../../../libs/openFrameworks/ofMain.h:40,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.h:5,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.cpp:1:  
/usr/include/gstreamer-0.10/gst/gstconfig.h:171:28: warning: libxml/parser.h: No such file or directory  
In file included from /usr/include/gstreamer-0.10/gst/gstelement.h:52,  
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,  
                 from /usr/include/gstreamer-0.10/gst/gst.h:34,  
                 from ../../../libs/openFrameworks/video/ofVideoPlayer.h:9,  
                 from ../../../libs/openFrameworks/ofMain.h:40,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.h:5,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.cpp:1:  
/usr/include/gstreamer-0.10/gst/gstobject.h:260: error: ‘xmlNodePtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstobject.h:265: error: expected identifier before ‘*’ token  
/usr/include/gstreamer-0.10/gst/gstobject.h:265: error: ‘xmlNodePtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstobject.h:265: error: ISO C++ forbids declaration of ‘xmlNodePtr’ with no type  
/usr/include/gstreamer-0.10/gst/gstobject.h:265: error: ‘xmlNodePtr’ declared as function returning a function  
/usr/include/gstreamer-0.10/gst/gstobject.h:266: error: ‘xmlNodePtr’ is not a type  
/usr/include/gstreamer-0.10/gst/gstobject.h:306: error: ‘xmlNodePtr’ does not name a type  
/usr/include/gstreamer-0.10/gst/gstobject.h:307: error: ‘xmlNodePtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstobject.h:324: error: ‘xmlNodePtr’ has not been declared  
In file included from /usr/include/gstreamer-0.10/gst/gstbuffer.h:29,  
                 from /usr/include/gstreamer-0.10/gst/gstpad.h:30,  
                 from /usr/include/gstreamer-0.10/gst/gstelement.h:53,  
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,  
                 from /usr/include/gstreamer-0.10/gst/gst.h:34,  
                 from ../../../libs/openFrameworks/video/ofVideoPlayer.h:9,  
                 from ../../../libs/openFrameworks/ofMain.h:40,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.h:5,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.cpp:1:  
/usr/include/gstreamer-0.10/gst/gstcaps.h:241: error: ‘xmlNodePtr’ does not name a type  
/usr/include/gstreamer-0.10/gst/gstcaps.h:243: error: ‘xmlNodePtr’ was not declared in this scope  
In file included from /usr/include/gstreamer-0.10/gst/gstelement.h:53,  
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,  
                 from /usr/include/gstreamer-0.10/gst/gst.h:34,  
                 from ../../../libs/openFrameworks/video/ofVideoPlayer.h:9,  
                 from ../../../libs/openFrameworks/ofMain.h:40,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.h:5,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.cpp:1:  
/usr/include/gstreamer-0.10/gst/gstpad.h:914: error: variable or field ‘gst_pad_load_and_link’ declared void  
/usr/include/gstreamer-0.10/gst/gstpad.h:914: error: ‘xmlNodePtr’ was not declared in this scope  
/usr/include/gstreamer-0.10/gst/gstpad.h:914: error: expected primary-expression before ‘*’ token  
/usr/include/gstreamer-0.10/gst/gstpad.h:914: error: ‘parent’ was not declared in this scope  
In file included from /usr/include/gstreamer-0.10/gst/gst.h:73,  
                 from ../../../libs/openFrameworks/video/ofVideoPlayer.h:9,  
                 from ../../../libs/openFrameworks/ofMain.h:40,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.h:5,  
                 from /home/markbao/development/openframeworks/apps/myApps/foundation/src/testApp.cpp:1:  
/usr/include/gstreamer-0.10/gst/gstxml.h:57: error: ‘xmlNsPtr’ does not name a type  
/usr/include/gstreamer-0.10/gst/gstxml.h:67: error: ‘xmlNodePtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstxml.h:68: error: ‘xmlNodePtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstxml.h:77: error: ‘xmlDocPtr’ does not name a type  
/usr/include/gstreamer-0.10/gst/gstxml.h:84: error: ‘xmlDocPtr’ has not been declared  
/usr/include/gstreamer-0.10/gst/gstxml.h:92: error: ‘xmlNodePtr’ was not declared in this scope  
/usr/include/gstreamer-0.10/gst/gstxml.h:92: error: expected primary-expression before ‘*’ token  
/usr/include/gstreamer-0.10/gst/gstxml.h:92: error: ‘parent’ was not declared in this scope  
/usr/include/gstreamer-0.10/gst/gstxml.h:92: error: initializer expression list treated as compound expression  
Process terminated with status 1 (0 minutes, 2 seconds)  
24 errors, 1 warnings  
  

and a ton of bulid messages…

  
  
/usr/include/gstreamer-0.10/gst/gstconfig.h|171|warning: libxml/parser.h: No such file or directory|  
/usr/include/gstreamer-0.10/gst/gstobject.h|260|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstobject.h|265|error: expected identifier before ‘*’ token|  
/usr/include/gstreamer-0.10/gst/gstobject.h|265|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstobject.h|265|error: ISO C++ forbids declaration of ‘xmlNodePtr’ with no type|  
/usr/include/gstreamer-0.10/gst/gstobject.h|265|error: ‘xmlNodePtr’ declared as function returning a function|  
/usr/include/gstreamer-0.10/gst/gstobject.h|266|error: ‘xmlNodePtr’ is not a type|  
/usr/include/gstreamer-0.10/gst/gstobject.h|306|error: ‘xmlNodePtr’ does not name a type|  
/usr/include/gstreamer-0.10/gst/gstobject.h|307|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstobject.h|324|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstcaps.h|241|error: ‘xmlNodePtr’ does not name a type|  
/usr/include/gstreamer-0.10/gst/gstcaps.h|243|error: ‘xmlNodePtr’ was not declared in this scope|  
/usr/include/gstreamer-0.10/gst/gstpad.h|914|error: variable or field ‘gst_pad_load_and_link’ declared void|  
/usr/include/gstreamer-0.10/gst/gstpad.h|914|error: ‘xmlNodePtr’ was not declared in this scope|  
/usr/include/gstreamer-0.10/gst/gstpad.h|914|error: expected primary-expression before ‘*’ token|  
/usr/include/gstreamer-0.10/gst/gstpad.h|914|error: ‘parent’ was not declared in this scope|  
/usr/include/gstreamer-0.10/gst/gstxml.h|57|error: ‘xmlNsPtr’ does not name a type|  
/usr/include/gstreamer-0.10/gst/gstxml.h|67|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstxml.h|68|error: ‘xmlNodePtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstxml.h|77|error: ‘xmlDocPtr’ does not name a type|  
/usr/include/gstreamer-0.10/gst/gstxml.h|84|error: ‘xmlDocPtr’ has not been declared|  
/usr/include/gstreamer-0.10/gst/gstxml.h|92|error: ‘xmlNodePtr’ was not declared in this scope|  
/usr/include/gstreamer-0.10/gst/gstxml.h|92|error: expected primary-expression before ‘*’ token|  
/usr/include/gstreamer-0.10/gst/gstxml.h|92|error: ‘parent’ was not declared in this scope|  
/usr/include/gstreamer-0.10/gst/gstxml.h|92|error: initializer expression list treated as compound expression|  
||=== Build finished: 24 errors, 1 warnings ===|  
  

What’s going on?
Thanks! M

Hi,

The first error is due to the notoriously variable ffmpeg api…which working in 8.10 and 8.04 but is slightly different in 9.04. This will eventually be solved but for the moment you need to do this:

The first thing you need to do is make a small addition to ofUCUtils.cpp on line 303

  
  
			toRGB_convert_ctx = sws_getContext(  
							format.size.width, format.size.height, (PixelFormat) src_pix_fmt,  
							d_width, d_height, PIX_FMT_RGB24,  
							VIDEOGRABBER_RESIZE_FLAGS, NULL, NULL, NULL);  
  

Note “(PixelFormat)” typecast - that’s what you need to add. Once you have the line looking like the above code, do a “make clean” or clean the project from within codeblocks and let me know what errors you get (ignore any warnings).

With regards to the other error messages, I’m not sure why you are getting them…
Which example did you try and run?

Just at a glance, it looks like you are missing some package(s).
I recently installed OF on 9.04 and only had the PixelFormat error…so you shouldn’t really need to install anything else if the scripts ran correctly.

But perhaps try the following:

  
  
sudo apt-get install libxml2-dev  
  

Probably the next best thing to do is search the OF linux forum posts…people have made similar queries and that’s the best place to post Linux specific stuff :slight_smile:

yes, also try executing the install_codeblocks script. the one in ubuntu repositories is the current stale version, the on that install the scripts is the nightly builds and should work better with how 006 is organised

thanks all! I was able to get it up and working :slight_smile:

Hi all,

Thxs for the tips so far I made the change to line 303 and the examples compile. The graphics example runs but I get this problem with the video one.

(There’s even some French for local color)

alx@tatlin:~/Documents/downloads/of_preRelease_v0.06_linux_cb/apps/examples/moviePlayerExample/bin$ sudo ./clickToLaunchApp_Release.sh
/home/alx/Documents/downloads/of_preRelease_v0.06_linux_cb/apps/examples/moviePlayerExample/bin
** Message: don’t know how to handle video/x-svq, svqversion=(int)3, codec_data=(buffer)0000007c7374736400000000000000010000006c53565133000000000000000100032005534d4920000003c3000003c3014000f0004800000048000000000000000110536f72656e736f6e20566964656f20330000000000000000000000000000000018ffff00000012534d49205345514800000002ddc000000000, width=(int)320, height=(int)240, framerate=(fraction)600/7
OF_WARNING: GStreamer: cannot query time duration

** (:22726): WARNING **: gstvideo: failed to get caps of pad appsink0:sink
OF_ERROR: GStreamer: cannot query width and height
OF_ERROR: GStreamer Plugin: Embedded video playback halted; module player reported: Aucun décodeur n’est installé pour gérer ce fichier. Vous devriez probablement installer des greffons supplémentaires.
Segmentation fault

Merci,

Alexandre

that’s just a problem with codecs not already installed. to solve it just open the video file with totem, just double click on it, and the codecs will be automatically installed. then the app will run without problem