龐大的vlc看源碼需要一個工具,選擇QtCreator還是不錯的
1. 首先是vlc源碼編譯通過,
2. 源碼一定要編譯成debug可調式版本才能被QtCreator使用
在編譯通過的版本上覆制新的版本,
cp vlc-2.1.5 vlc_Debug2.1.5
cd vlc_Debug2.1.5
./configure --enable-debug
3.執行的過程中會出現很多問題.一般都是缺少庫文件,下載就可以了,解決如下
configure: error: Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts.
=》sudo apt-get install lua5.1 liblua5.1-dev
configure:error: Could not find libmad on your system: you may get it fromhttp://www.underbit.com/products/mad/.
=》sudo apt-get install libmad0-dev
configure:error: No package 'libpostproc' found.
=》sudo apt-get install libpostproc-dev
configure:error: Could not find liba52 on your system: you may get it fromhttp://liba52.sf.net/.
=》sudo apt-get install liba52-dev
configure:error: Package requirements (xcb >= 1.6) were not met:Requested 'xcb >=1.6' but version of XCB is 1.5
=》到http://xcb.freedesktop.org/dist/上下載最新的tarball,我下的是1.7的版本,即libxcb-1.7.tar.gz 和xcb-proto-1.7.tar.gz 裝好就可以了(先裝後者,否則前者裝不上)
tar -xzvflibxcb-1.11.tar.gz
cd libxcb-1.11&& ./configure
sudo make
sudo makeinstall
configure:error: libgcrypt version 1.1.94 or higher not found.
=》sudoapt-get install libgcrypt11-dev
configure: error: No package'alsa' found. alsa-lib 1.0.16 or later required.
下載 http://www.linuxfromscratch.org/blfs/view/svn/multimedia/alsa-lib.html
tar –jxvfalsa-lib-1.0.28.tar.bz2
繼續 ./configure --enable-debug出現如下表示配置成功
ibvlcconfiguration
--------------------
version : 2.1.5
system : linux
architecture : i686 mmx sse sse2
optimizations : yes
vlc aliases : cvlc rvlc qvlc
To build vlc andits plugins, type `make', or `./compile' if you like nice colors.
4.configure成功後,需要使用QtCreator打開文件,首先安裝QtCreator.在網上可以查找一下資料進行安裝
5.打開QtCreator後打開【新建】-->【導入項目】-->【導入現有項目】-->【添加項目名字】-->【選擇vlc_Debug路徑】點擊確定即可導入項目,可以調試了
6.優化這個QtCreator打開的vlc項目,這個打開的項目是把所有的能打開的都打開了,有的工程不需要怎麼辦.比如我們剛編譯好的win32目錄,還有test目錄,那就在根目錄下修改vlc_debug.files和vlc_debug.includes.
7.添加根目錄下的bin/目錄,bin目錄下的vlc.c中包含main函數式程序的入口.
8.vlc_debug.creator是ubuntu下的QtCreator的工程文件.
9.如果你打算使用gdb調試,需要到ubuntu機器上調試,有界面彈出,調試根目錄是/bin/vlc-static
在bin目錄下執行 gdb vlc-static
進入gdb下 r 執行 b <斷點位置> 設置斷點.