Problem when compiling examples in Ubuntu 9.10

Hi all, I’m having some little dependency problems (I guess) when compiling the examples in Ubuntu 9.10 (fresh install), I’ve ran the “install dependencies” script but I get some messages about missing headers, I’ve already installed some extra packages like ffmpeg and libswscale-dev, could you please help me with this? Here is compiler output when building through Makefile in eg. $HOME/of_preRelease_v0.06_linux_cb/apps/examples/advancedGraphicsExample

gcc -c src/main.cpp -o obj/Debug/src/main.o -Wall -fexceptions -I…/…/…/addons/ -I…/…/…/libs/openFrameworks/ -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/video -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/rtAudio -I…/…/…/libs/fmodex/inc -I…/…/…/libs/glee/include -I…/…/…/libs/glee/ -I…/…/…/libs/freeimage/Source -I…/…/…/libs/FreeImage -I…/…/…/libs/alsa/include -I…/…/…/libs/alsa/include/alsa -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/unicap/include -I…/…/…/libs/gstappsink/include -I…/…/…/addons -I…/…/…/libs/poco/include pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libavcodec libavformat libavutil libswscale --cflags -DLINUX -g -MMD
mkdir -p obj/Debug/libs/openframeworks/graphics/
gcc -c …/…/…/libs/openFrameworks/graphics/ofBitmapFont.cpp -o obj/Debug/libs/openframeworks/graphics/ofBitmapFont.o -Wall -fexceptions -I…/…/…/addons/ -I…/…/…/libs/openFrameworks/ -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/video -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/rtAudio -I…/…/…/libs/fmodex/inc -I…/…/…/libs/glee/include -I…/…/…/libs/glee/ -I…/…/…/libs/freeimage/Source -I…/…/…/libs/FreeImage -I…/…/…/libs/alsa/include -I…/…/…/libs/alsa/include/alsa -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/unicap/include -I…/…/…/libs/gstappsink/include -I…/…/…/addons -I…/…/…/libs/poco/include pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libavcodec libavformat libavutil libswscale --cflags -DLINUX -g -MMD
mkdir -p obj/Debug/libs/openframeworks/video/
gcc -c …/…/…/libs/openFrameworks/video/ofUCUtils.cpp -o obj/Debug/libs/openframeworks/video/ofUCUtils.o -Wall -fexceptions -I…/…/…/addons/ -I…/…/…/libs/openFrameworks/ -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/video -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/rtAudio -I…/…/…/libs/fmodex/inc -I…/…/…/libs/glee/include -I…/…/…/libs/glee/ -I…/…/…/libs/freeimage/Source -I…/…/…/libs/FreeImage -I…/…/…/libs/alsa/include -I…/…/…/libs/alsa/include/alsa -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/unicap/include -I…/…/…/libs/gstappsink/include -I…/…/…/addons -I…/…/…/libs/poco/include pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libavcodec libavformat libavutil libswscale --cflags -DLINUX -g -MMD
…/…/…/libs/openFrameworks/video/ofUCUtils.cpp:19:22: warning: avformat.h: No existe el fichero ó directorio
…/…/…/libs/openFrameworks/video/ofUCUtils.cpp:20:21: warning: swscale.h: No existe el fichero ó directorio
…/…/…/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

Thanks in advance and really awesome framework :wink:

Hi,

there are several posts in the Linux forum about this.
substitute line 300 in ofUCUtils.cpp with:

  
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);  

It’s the cast to (PixelFormat) that’s the important bit.

What are the prospects for this bug getting fixed soon? I bet a lot of potential users are put right off by the examples just not compiling, and it’s so easy to fix that it seems like someone should be able to just add that (pixelFormat) to the file people are downloading with a few minutes’ work…?

sorry, have been waiting to fix this in a minor 0061release, but it’s been a while since we planed to release it and is not ready yet. it’s fixed now in the downloads.

Excellent, thanks arturo.

Most users of Ubuntu 9.10 will probably also need to read http://forum.openframeworks.cc/t/codeblocs-error-after-upgrading-to-ubuntu-karmic/2784/2">codeblocs error after upgrading to Ubuntu Karmic]http://forum.openframeworks.cc/t/codeblocs-error-after-upgrading-to-ubuntu-karmic/2784/2 - I had to follow grimus’ instructions to get it to work here. It’s running at last now!

And I’m pleased to report that once c::b runs at all, it compiles and runs examples without any need to insert added casting to the libraries. :slight_smile: