How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)

3 篇文章 0 订阅

from:http://pankajthaulia.blogspot.com/2011/05/how-to-compile-and-debug-vlc-player.html


How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)?


I had been searching for compilation and debugging of the VLC source code in eclipse IDE for a long long time. I could not get much success though. But, finally I got it by myself. And now, I want to share my experience with others, so that guys like me can take the advantage and explore further.


Here is the step by step process of how to compile and debug the source code of VLC media player  in eclipse IDE on Ubuntu 10.04.


Prerequisites:
1. eclipse IDE for C/C++ 
[can be downloaded from: http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz ]


2. source code for VLC media player
[can be downloaded from: http://sourceforge.net/projects/vlc/files/1.1.9/vlc-1.1.9.tar.bz2/download ]


3. Working Internet connection.[probably you may have to download some libraries/packages]


Steps:


Step 1: Download and extraction of code:
    1.1: Download the source code of vlc and save it somewhere [e.g /home/<username>/Downloads]. I am using the latest one [i.e vlc-1.1.9.tar.bz2 ]. 
    1.2: Extract it. To extract...
-open terminal: Applications-> Accessories-> Terminal
-go to that directory in which source code is kept.
-and run the command: $tar -xvf  vlc-1.1.9.tar.bz2
-this will extract the contents into folder vlc-1.1.9 


Step 2: Configure the source code: this step may take several iterations while configuring. Why?, because you may have to resolve some errors while configuring
    2.1: to configure...
-go to the folder vlc-1.1.9
-run the command: $./configure 
-if no errors appear, then you are done with configuring the code. Move on to the next step.
-if there are errors, then resolve those error by some means and again run $./configure command.


Error examples: In my case one of the errors was...


To resolve this error, I downloaded and installed libdbus-dev library. For that I did the following...
-open Synaptic Package Manager [System-> Administration-> Synaptic Package Manager]. It will need root/admin password. And enter the library name which needs to be installed.




-right click on the selected library and select 'Mark for Installation'.
-After that click on Apply button[green tick].
-A summary dialog box will open. Click on apply.
-This will download the library and apply the changes[installation].
-After change have been applied. Run the $./configure command. If still errors appear. Do repeat the same process until no errors appear and configuration is successful.
Note: if that doesn't solve the purpose, you may try disabling that library/package by running $./configure –disable-<pack/lib name1> –disable-<pack/lib name2> –disable-<pack/lib name3> ... .




Step 3: Creating and compiling vlc project in eclipse.


    3.1: Download and extract the eclipse file [eclipse-cpp-helios-SR2-linux-gtk.tar.gz] to a folder. Go to eclipse folder and run eclipse executable to run the eclipse IDE.


3.2: Choose a workspace folder.




3.3: Now go to File->New->Project... . A wizard will open. 
-Select C/C++ -> C Project, and click Next.


-Enter the project name same as the configured vlc source code folder name [in my case vlc-1.1.9]


-Select project type as Makefile Project-> Empty Project
-Select tool chain as Linux GCC and click on Finish button.



3.4: Importing source code:
-Right click on the project name [vlc-1.1.9] in Project Explorer [left pane] and select Import... . A wizard will open.
-Select General->File System and click on Next button.
  


-Select from directory of configured source code.
-Check the check-box to select all the files inside source folder.
-Click Finish button.


This will import the source code into the project. And start indexing and then after building the source code automatically if Build Automatically option is checked under Project menu of eclipse.


3.5: Building the source code: Once the indexing is done...
-Go to Project-> Build All. And the code will start building...




3.6: Running the vlc after build.
-Right click on the project name [vlc-1.1.9] in Project Explorer [left pane] and select Run As->Run Configurations... . A wizard will open.
-Click on Search Project... button and select vlc as below...
-Click on OK button and then Run button.


This will run the vlc player.
This is it!


And now, as you have vlc-1.1.9 source code configured on your eclipse IDE on Ubuntu 10.04(lucid), you can go through the code, explore it, play with it, and debug it accordingly.




Enjoy!!


Please write your comments, suggestions, inputs as they are always welcome.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值