How to use CPPLint in Eclipse CDT

Errors found by CPPLint in Eclipse CDT
Errors found by CPPLint in Eclipse CDT

CPPLint is a tool created by Google that can be used to check a C++ source or header file. It is a single file Python script. It would be nice to apply CPPLint on a C++ file in Eclipse CDT whenever it is saved. This is possible by using the CPPStyle plugin for Eclipse. It runs on a saved C++ file and displays the reported errors conveniently in a Problems view, as shown in screenshot above.

  • First install CPPLint:
$ sudo curl -L "" -o /usr/bin/
$ sudo chmod a+x /usr/bin/
  • Install CPPStyle plugin in Eclipse. Open Help -> Install New Software and the URL to install it. Eclipse will be restarted after that.

  • Open Window -> Preferences -> C/C++ -> CPPStyle. Enable the Enable cpplint on save option.

  • Edit and save any C++ file. CPPLint will be run on it. If there are any problems, you can see the output in Console view or see them listed nicely in Problems view.

Tried with: CPPStyle 1.0.0 and Eclipse Luna 4.4.1


One thought on “How to use CPPLint in Eclipse CDT”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s