VLC and IDE
By JBK on Thursday, April 30 2009, 08:19 - VideoLAN - Permalink
I receive many questions about using an IDE to build VLC.
Usually, the answer is VIM. But I will try to introduce something else today.
Needs
Yeah, VIM is TEH awesome, but sometimes we would like more. But usually, more is slow, incomplete and boring...
Would you want an editor with:
- VIM syntax and command,
- Completion that is faster than the one from Eclipse
- Git inclusion
- Doesn't eat all your RAM
- Debuggueur and step-by-step+breakpoints integration like MSVC?
I guess so!
Believe it or not, there is a solution: QtCreator from Nokia/QtSoftware that I have tested to work with VLC.
Even if you don't think this will be useful for you, at least read in diagonale the following post.
Installation
- Take QtCreator 1.1 (don't take older versions, they won't fit for VLC, or the VIM part will suck...)
`apt-get install qtcreator` in Debian/Sid
- Take Qt4.5.1 (I mean it, Qt 4.5.0 is buggy!)
Setup
General Setup
- Run QtCreator and launch Tools->options
- Activate FakeVim and set ShiftWidth to 4
- Text Editor->Behaviour, set Tab size at 4
- Text Editor->Display, enable Text Wrapping and display right margin, and if you like Alexis' vim, Visualize whitespace
- Text Editor, change the colour schemes to match you old editor

- Save options.
VLC Setup
For the example, I assume that you build your vlc in a "build" subdir of the source (as xtophe usually gives advice)
* File->New Select 'Import of Makefile-based Project'- Project Name 'VLC' Location '/home/you/vlc' and Choose, Next- Let it process... It should take around 1minute Finish.
- EXIT QtCreator... I MEAN it.
Setup Indexation
QtCreator will have done VLC.includes VLC.creator, VLC.files and a VLC.config in your vlc/ folder.
Overwrite the VLC.includes and the VLC.files with the one you can find:
- http://people.videolan.org/~jb/QtCreator/VLC.files
- http://people.videolan.org/~jb/QtCreator/VLC.includes
Doing this will gain you some time. Those could be auto-generated one day, I guess...
Setup Build
Relaunch QtCreator
- Select Projects (on the left) and select VLC on the list
- Build Settings,
- Change Build directory to /home/you/vlc/build, using browse
- Run Settings,
- Add a custom Executable with the blue '+'
- Name it VLC, browse to /home/you/vlc/build/vlc for Executable
- Put -Iqt in Arguments
- Click on Edit on the left. You should see VLC with most useful files.
Build VLC and launch it.
- In the Menu, Build and Build All, you should see the Compilation output on the bottom (or by clicking on the left build progressbar)
- In the same menu, Build and Run it, and VLC will launch directly, outputting everything in the Application output.
Cool. But that was just a minimum...
Using it like VIM: Good!
Open modules/codec/avcodec/audio.c from the file browser and see... You are using VIM commands to control. You have Visual, Edit and all usual VIM modes!
- Completion is triggered with Ctrl+Space and will give you a list. If there is no ambiguition, it is filled.
- . and -> triggers the list of the members of the struct or the class by default.
- After function completions, it will give the type of the arguments.
- F2 will give you access to the function definition where your mouse is.
Debugging it: awesome!
- You can put breakpoints in the margins near the line numbers. (Like in modules/gui/qt4/main_interface.cpp:100 and 108)
- Now re run it using debug running.
It will stop at your breakpoint and you will have the function call lists (and line numbers) but also pointers values (like p_intf, and this in main_interface.cpp)

You can, of course Step In, Step Into and Step Out, resume or stop the code
More coolness:
Locate
Use the locate search box to find quick declarations:
'm vlc_object_act' will help you to go quickly to the method declaration, etc...
Git
Use the Git menu to checkout from within QtCreator.
Nota Bene
The indexing shouldn't be too long, but could be a bit longer the first time you launch the project!
Have fun!
Comments
EXCELLENT! Thanks. Exactly the software I was looking for.
Is this good enough for convincing a few friends of mine to switch to Qt who are used to MS Visual Basic ?
You might need to wait for 1 or 2 releases of QtCreator to tell them to switch.
What I meant was, is this the kind of software which allows point and click kind of programming, atleast on Linux, similar to Visual Basic or Visual C++ on windows ?
I am with a bunch of guys who are completely used to dragging and dropping widgets and right clicking and coding them, or better still, using inbuilt tools to do the coding while they select options.
It only works with some 1.1.0 builds. My 1.1.0 rpm doesn’t provide any Makefile project import.
If you want to be sure, just get the whole package directly from QT.
I did exactly and got this error "Could not start process make
Error while building project VLC
When executing build step ‘Make’ "
Can you please help me with this.
I’m using win xp pro and my dir for vlc src is c:\vlv\vlc
Thank you,
Roman
hi~
i got the same error as the 5th comment.
my os is xp sp2.
build vlc in cygwin.
Sorry, guys, but on windows, you have to compile a VLC first, before running make, and this is far from trivial.
the post is informative.
But can you please describe me about how to start coding for VLC.
I cant understand the insides in my first second and third looks.
pls let me know how to beginners code for VLC
thanks in advance.
Anoop
Hi,
Super… This was very useful, I am able to use it as debugger[Start and debug external application].
But, I too got same error as 5th comment, i have already compiled VLC before, using mingw tool and got exe built, But it gives error when i do it QT, Please help for building with QT.
Thanks and Regards
Santhosh
Generally I do not post on blogs, but I would like to say that this post really forced me to do so,Excellent post!