Friday, March 21, 2014

Adding New Directory to CodeBlocks Code Completion

CodeBlocks (http://www.codeblocks.org) cannot enumerate all of the possible C/C++ include directories automatically in some cases. For example, when you are using 3rd party C/C++ libraries which are installed in non-standard path. At least that's the state of CodeBlocks v13.12.

Now, how do you go about adding new directories to be added to the codecompletion parser? The procedure is explained in CodeBlocks FAQ at http://wiki.codeblocks.org/index.php?title=FAQ-Settings. However, as I found out, only the second method works in CodeBlocks v13.12, i.e. only the per-project non-standard include directories (to be parsed) can be configured. These are the steps:

  1. Activate the project (either by double clicking on it in the Projects pane or right click on the project and then click "Activate")
  2. Click on the "Project | Properties" menu. 
  3. Click on the "C/C++ parser options" tab. 
  4. Add the additional include directory to be parsed by the Code Completion plugin.
  5. Click on OK.
Now, you should have code completion working in CodeBlocks editor. If it's not working yet, you might need to close the project and re-open the project again.


Post a Comment

No comments: