Compiling QtCreator with Clang parser on Ubuntu
Firstly, you need to install LLVM 3.2 and Clang compiler. Be sure to remove old ones if they’re installed:
sudo apt-get autoremove --purge llvm clang
Download the binaries from this page:
http://llvm.org/releases/download.html#3.2
You need to extract the files from the archive to /usr folder. Here is the script which will do the job for you:
cd Downloads && tar xvzf clang+llvm-3.2* && sudo cp -r clang+llvm-3.2*/* /usr && rm -rf clang+llvm-3.2*
If you would want to remove it at some point, here is the script as well.
In order to clone the code from a repository, you need to install git. Also, g++ and Qt must be installed:
sudo apt-get install git g++ qt4-default
Now clone and compile QtCreator Clang branch with these commands:
git clone git://gitorious.org/+qtcreator-clang-edgers/qt-creator/qtcreator-clang-stable.git cd qtcreator-clang-stable qmake -r LLVM_INSTALL_DIR=/usr make
To run application, run qtcreator file in the bin folder:
./bin/qtcreator
Activate Clang parser by going to Help -> About Plugins… and enable ClangCodeModel plugin. Restart the app and enjoy coding!
Source links:
http://qt-project.org/wiki/wip-clang-setting-up
https://qt.gitorious.org/+qtcreator-clang-edgers/qt-creator/qtcreator-clang-stable