Icarus and C++ code completion on external paths

Hello everyone!

I want to use nova to develop a c++ game engine. I was wondering if there’s a way to add paths so that I can get auto completion from external libraries I’m using.

For example, in vscode, there’s a project-scecific configuration called “includePath” that I can populate to achieve this.

Is there anything I can do?

PD: please let me know if this has been asked before, I tried looking for similar topics to no avail.

Thank you all for your time!

EDIT: As a workaround, I simply added the paths to CPATH and LIBRARY_PATH as needed on the .zshrc and .bash_profile.

export CPATH=/opt/homebrew/include:$CPATH
export LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH

Hey guys, just want to bump this. I’m trying to use Icarus for C/C++ as well and any header files that aren’t in the project folder show up as red errors all over the editor.

How do we configure where Icarus looks for headers?

I tried adding the paths to CPATH the way Pablo suggested but nothing in the editor changed.

Thanks!

1 Like

Icarus itself doesn’t have a setting for this, however the tooling it uses does. Clang has two options, both covered here.

If you’re doing something simple (as I often do) and just need to include some paths, the latter compile_flags.txt is the way to go. Just create that file on the root of your project with the appropriate -I and /path/to/headers on separate lines, then close and reopen your project so clangd picks up the change.

If instead you have a complex build setup, like Cmake, it can generate the appropriate compile_commands.json file for you.

After either of these, clangd and Icarus should see your external headers during autocomplete and such.

2 Likes

Thank you! This is exactly what I was looking for.

1 Like