安装SDL:
Ubuntu已经包含SDL库,所以通过几个简单的命令就可以安装,比windows还傻瓜!
sudo apt-get install libsdl1.2-dev(比较大,10M左右)
附加包:
sudo apt-get install libsdl-image1.2-dev
sudo apt-get install libsdl-mixer1.2-dev
sudo apt-get install libsdl-ttf2.0-dev
sudo apt-get install libsdl-gfx1.2-dev
安装完成之后,在目录/usr/include中,就会有个SDL文件夹,里面包含了所需要的头文件。
2、安装spcaview
(1)解压
(2)make
错误1:没有<linux/videodev.h> 头文件
解决1:#include <linux/videodev2.h>
#include <libv4l1-videodev.h>
任何.c的报错,都用以上解决方法,
错误2:“BASE_OPRATE****”
解决2:进入xx.c
宏定义 #define BASE_OPRATE*** 198
谷歌解决的。
错误3:
/usr/bin/ld: spcaview.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
/usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [spcaview] Error 1
解决3:
gcc -DUSE_SDL -O2 -DLINUX-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT spcaview.o utils.o tcputils.o picture.o encoder.o huffman.o marker.o quant.o avilib.odpsh.o shc.o shclib.o audioin_devdsp.o SDL_audioin.o -lm -L/usr/lib/i386-linux-gnu -lSDL -lpthread -o spcaview
添加红色的部分。。
纠结死我了,总算解决了。。。