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

No custom include path in compiler command line #271

Closed
aunoor opened this issue Aug 20, 2015 · 5 comments
Closed

No custom include path in compiler command line #271

aunoor opened this issue Aug 20, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@aunoor
Copy link

aunoor commented Aug 20, 2015

If add to src_build any -I directive containing relative path, then platformio parser just throw it away.
Example:
src_build = -I/home/user/include - work, if dir exist
src_build = -I. - don't work

@ivankravets ivankravets self-assigned this Aug 20, 2015
@ivankravets ivankravets added this to the 2.3.0 milestone Aug 20, 2015
@ivankravets ivankravets modified the milestones: 2.3.0, 2.3.1 Sep 4, 2015
@TD22057
Copy link

TD22057 commented Sep 4, 2015

This is also an issue on windows. I build a default project with SublimeText which creates a src and lib directory but the lib directory is not put in the path. So I tried adding it to the config file and can't figure out any way to do it on Windows 7, with platformio 2.2.2. Here are the various things I tried and what I see on the compiler line:

Input: src_build_flags = -Ic:/Users/foo/project/lib
Compiler: -Ilib

Input: src_build_flags = -I/Users/foo/project/lib
Compiler: -Ilib

Input: src_build_flags = -I../lib
Compiler: -Ilib

Is there any work around? This is pretty crippling at this point.

@ivankravets
Copy link
Member

@TD22057 PlatformIO automatically handles libraries from lib directory. Each lib should be placed in own directory. See docs http://docs.platformio.org/en/latest/userguide/cmd_init.html#description

As for this issue - I'll work on it. Sorry for the troubles 😢

@ivankravets ivankravets modified the milestones: 2.3.0, 2.3.1 Sep 5, 2015
@TD22057
Copy link

TD22057 commented Sep 5, 2015

Thanks. Off topic: I was hoping to not have a flat library (lib/LIB_NAME/SOURCE) structure and use platformio. There are way too many libraries with the same names so I was hoping to have lib/DIR/LIB_NAME/SOURCE and then say "#include "DIR/LIB_NAME/File.h" in my code. Of course I'm coming from a regular C++ dev background so perhaps that's the wrong way to think about Arduino...

@ivankravets
Copy link
Member

@TD22057 PlatformIO looks for source code of libraries in lib/DIRs. Try this:

#include <LIB_NAME/File.h>
  • don't need additional flags
  • PlatformIO will automatically find dependencies from your source files and built static libs. You should see it in build result.

Please report me if you still have problems.

@ivankravets ivankravets modified the milestones: 2.3.0, 2.3.1, 2.3.2, 2.3.3 Sep 5, 2015
@ivankravets ivankravets modified the milestones: 2.4.0, 2.3.3 Oct 1, 2015
@ivankravets ivankravets modified the milestones: 2.3.5, 2.4.0 Nov 18, 2015
@ivankravets ivankravets modified the milestones: 2.3.5, 2.3.6, 3.0.0 Nov 18, 2015
@ivankravets ivankravets modified the milestones: 2.3.6, 3.0.0 Nov 27, 2015
@ivankravets
Copy link
Member

Dear @aunoor, @TD22057,

Please re-test the latest PlatformIO 2.3.6.dev3 http://docs.platformio.org/en/latest/installation.html#development-version

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

No branches or pull requests

3 participants