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

[Eclipse] Include path search order is inconsistent to what passed to the compiler #2509

Closed
dogtopus opened this issue May 17, 2019 · 1 comment

Comments

2 participants
@dogtopus
Copy link

commented May 17, 2019

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Configuration

Operating system: Arch Linux

PlatformIO Version (platformio --version): 4.0.0a13

Description of problem

When generating a Eclipse project, PlatformIO writes the include search path backwards. This results in Eclipse not being able to read the same header files as the compiler when there is a name collision between project header files and library header files.

Steps to Reproduce

  1. Install a library that contains header H.
  2. Create a different header in project and name it H.
  3. Include H somewhere in the project.
  4. Open project in Eclipse and browse through source file.

Actual Results

Eclipse complains about undefined symbols despite that they were defined in H (project) (but not in H (library)). Using the "Jump to Declaration" feature on the include statement jumps to H (library). The project builds okay using pio run.

Expected Results

Eclipse resolves the include correctly and using the "Jump to Declaration" feature on the include statement jumps to H (project).

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:uno]
platform = atmelavr
board = uno
framework = arduino

Source file to reproduce issue:
lib/Library/header.h:

#pragma once

#define IN_LIBRARY

include/header.h:

#pragma once

#define IN_PROJECT

src/main.cpp:

#include <Arduino.h>
#include "header.h"

#ifdef IN_LIBRARY
#warning "In library"
#endif

#ifdef IN_PROJECT
#warning "In project"
#endif

void setup() {}
void loop() {}

Additional info

warn

@ivankravets ivankravets added this to the 4.0 milestone May 23, 2019

@ivankravets ivankravets added this to To do in PlatformIO 4.0 May 23, 2019

@ivankravets ivankravets moved this from To do to In progress in PlatformIO 4.0 May 24, 2019

@ivankravets ivankravets modified the milestones: 4.0, 3.6.8 May 24, 2019

@ivankravets ivankravets removed this from In progress in PlatformIO 4.0 May 24, 2019

@ivankravets

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Please re-test with pio upgrade --dev.

ivankravets added a commit that referenced this issue May 24, 2019

Fix an issue for Project Generator when include path search order is …
…inconsistent to what passed to the compiler // Resolve #2509

@ivankravets ivankravets modified the milestones: 3.6.8, 4.0 May 27, 2019

@ivankravets ivankravets added this to Done in PlatformIO 4.0 May 27, 2019

@ivankravets ivankravets added this to Done in PlatformIO 4.0 May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.