(1)

per a compilar:
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/lib/R/site-library/Rcpp/lib/:/usr/local/lib/R/site-library/RInside/lib/:/usr/lib/R/lib/:.:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=.

sino dona l'error:

/usr/local/lib/libhighgui.so: undefined reference to `av_read_frame@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_write_header@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_close_input_file@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_write_frame@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_codec_get_id@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_open_input_file@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `url_fclose@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `guess_format@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_register_all@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_find_stream_info@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_set_parameters@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `dump_format@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_write_trailer@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_alloc_format_context@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_guess_codec@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `url_fopen@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_new_stream@LIBAVFORMAT_52'
/usr/local/lib/libhighgui.so: undefined reference to `av_seek_frame@LIBAVFORMAT_52'
collect2: ld returned 1 exit status

(2)

g++ `pkg-config --cflags opencv` kneeAngle.cpp -o kneeAngle `pkg-config --libs opencv`

(3)
Pel meu 9.10 amb molts OpenCVs instal·lats, per a que agafi el oficial enlloc de els "local". No posar res a LD_LIBRARY_PATH

g++ -I/usr/include/opencv -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/lib -I/usr/local/lib/R/site-library/RInside/lib  -g -O2 -Wall  -s  kneeAngle.cpp -o kneeAngle -L/usr/lib/R/lib -lR -lblas -llapack -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/local/lib/R/site-library/RInside/lib -lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -L/usr/lib -lhighgui -Wl,-rpath,/usr/lib


