/Teaching/Operating Systems/Tutorials/Configuring your IDE

Configuring your IDE

CLion setup

Just open the project folder, everything should work out of the box. You should delete unused architecture files to avoid confusions (see previous section).

The code completion and analysis usually works much faster and is more reliable than Eclipse.

Some keyboaord shortcuts may be conflicting with your Window Manager. Have a look in the Settings to change any important shortcuts (“Forwards” and “Backwards” are very helpful IMHO)

Eclipse setup

Disclaimer: Eclipse for C++ can be very hard to get working. Also, its indexer is known to cause problems every now and again, because Eclipse does not have a good understanding of C++. I can only recommend CLion as an alternative that has really good C++ tooling (skogler, 03-2016).

 

Definition of Arch Constant

Eclipse should actually detect the definition of CMAKE_X86_64 by itself. But sometimes it does not. In this case go to Project → Properties → C/C++ General → Paths and Symbols → Symbols → Add: CMAKE_X86_64 with value 1 and add it to all configurations and all languages.

 

Filtering unused architecture resources

In order to filter architecture resources you don’t need:

    1. Open your SWEB project in Eclipse
    2. Open the project properties
    3. Choose Resource → Resource Filters in the list on the left
    4. You have to add filters with
      1. Filter type: Exclude all
      2. Applies to: Folders, All children (recursive)
    5. Add 4 filters with the following values for “Name matches”:
      1. arm
      2. pae
      3. xen
      4. 32

After you have added the filters, the “Resource Filters” list should show the following:

    1. Include only:
    2. Exclude all:
      1. Name matches arm (recursive)
      2. Name matches pae (recursive)
      3. Name matches xen (recursive)
      4. Name matches 32 (recursive)

Code completion or unresolved symbol problems

If it does not work to just create a new C/C++ Makefile project you can try to create the project files using cmake -G “Eclipse CDT4 - Unix Makefiles” .in the source directory.

Then backup the eclipse project files out of your source directory and remove the additional CMake files (and all untracked files) using

git clean -d -n # check whether there is something you still need 
git clean -d -f # delete the files listed before

Then copy the eclipse project files back into the source directory and create the C/C++ project as before.

Also try Index → Rebuild, sometimes that helps.

 

Configuring the Indexer

I configured Preferences → C/C++ indexer as follows:

    • [x] Enable indexer
    • [x] Index source files not included in the build
    • [x] Index unused headers
    • [x] Index all header variants
    • [x] Index source and header files opened in editor
    • [x] Allow heuristic resolution of includes
    • Skip files larger than: 8 MB (!)
    • [ ] Skip all references
    • [ ] Skip implicit references
    • [ ] Skip type and macro references
    • [x] Automatically update the index
    • [x] Update index immediately after every file-save
    • Index database cache – Limit relative to the maximum heap size: 15%
    • Index database cache – Absolute Limit: 256MB
    • Header file cache – Absolute Limit: 256MB