Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Include Folders #18

Closed
tmakuch opened this issue Apr 18, 2016 · 6 comments
Closed

Additional Include Folders #18

tmakuch opened this issue Apr 18, 2016 · 6 comments

Comments

@tmakuch
Copy link

tmakuch commented Apr 18, 2016

Additional Include Folders would be great for IoT development.

@sridmad
Copy link
Member

sridmad commented Apr 20, 2016

Following should allow you to specify additional include folders

CTRL + P to bring up the command windows. Type the following and hit enter

C/Cpp: Edit Configurations

It will create a configuration file that allows you to specify additional include folders in the following format

includePath:["path1", "path2"]

@eliotstock
Copy link

I can't get this to work. If I use:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": ["~/dev/nRF5_SDK_11.0.0_89a8197/components/",
                "~/dev/nRF5_SDK_11.0.0_89a8197/components/ble",
                "~/dev/nRF5_SDK_11.0.0_89a8197/external/segger_rtt"]
        },
        {
            "name": "Linux",
            "includePath": ["/usr/include"]
        },
        {
            "name": "Win32",
            "includePath": ["c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"]
        }
    ]
}

Then place the cursor in a function name in main.c and hit F12, I'd expect to do to the definition of that function, which is in a file in ~/dev/nRF5_SDK_11.0.0_89a8197/external/segger_rtt. Nothing happens.

Can I expect this to work?

@spinicist
Copy link

This feature half works for me. However, it seems to fail if my includes have this form:
# include <directory/header_name>
I use the Eigen library a lot, and all the includes have Eigen/ at the front. Includes that have no directory at the front seem to work fine with includePath.

@jgoshi
Copy link
Member

jgoshi commented Jun 30, 2016

In the next release, version 0.8.0, we will support subdirectories in include paths (ex: #include <directory/header_name>).

As for the other part of this bug, we currently do not support "" syntax such as "/dev/nRF5_SDK_11.0.0_89a8197/components/ble". I'm closing this bug but you can track that work in the following issue.
#87

@jgoshi jgoshi closed this as completed Jun 30, 2016
@spinicist
Copy link

Looking forward to it.

@guoqingaa
Copy link

Win32, includePath? help me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants