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

subfolder of lib mustn't be named *config* #1914

Closed
atsteich opened this Issue Nov 7, 2018 · 8 comments

Comments

Projects
None yet
2 participants
@atsteich

atsteich commented Nov 7, 2018

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

You can erase any parts of this template not applicable to your Issue.


Configuration

Ubuntu 17.04 system:

3.6.2a2

I have the following folder structure, and everything is working fine.

|-- Projectfolder
    |-- include
        |-- README
    |-- lib
        |-- lib1
            |-- src
                |-- lib1.h
                |-- lib1.cpp
        |-- lib2
            |-- src
                |-- lib2.h
                |--  lib2.cpp
    |-- src
        |-- main.cpp
    |-- platformio.ini

code of lib1.h:
void func1();

code of lib1.cpp:

void func1(){ 
    //doanythinghere 
}

code of lib2.h:
void func2();

code of lib2.cpp:

#include <lib1.h>

void func2(){
    func1();
}

code of main.cpp

#include <lib2.h>

void setup(){
}

void loop(){
    func2();
}

BUT: As soon I am renaming

lib1 -> config
lib1.h -> config.h
lib1.cpp -> config.cpp

I get an Compile Error:
lib/lib2/src/lib2.cpp:4:11: error: 'func1' was not declared in this scope

If for any reason this is not a bug but a feature, it should be mentioned in the Readme, i spent almost a day on finding out that the problem is the name of the lib...

The content of platformio.ini:

[env:featheresp32]
platform = espressif32
board = featheresp32
framework = arduino
@ivankravets

This comment has been minimized.

Member

ivankravets commented Nov 10, 2018

Did you rename #include <lib1.h> in lib2.cpp:?

@atsteich

This comment has been minimized.

atsteich commented Nov 10, 2018

Did you rename #include <lib1.h> in lib2.cpp:?

Of course!

@ivankravets

This comment has been minimized.

Member

ivankravets commented Nov 10, 2018

Please provide archive with a simple project to reproduce this issue. Thanks!

@atsteich

This comment has been minimized.

atsteich commented Nov 10, 2018

you can find it on my github account: https://github.com/atsteich/pub

@atsteich

This comment has been minimized.

atsteich commented Nov 19, 2018

has anybody been able to reproduce?

@ivankravets ivankravets added bug and removed help wanted labels Nov 19, 2018

@ivankravets

This comment has been minimized.

Member

ivankravets commented Nov 19, 2018

Sorry for delay. Please upgrade PIO Core to the latest dev version via pio upgrade --dev. Does it work now?

@ivankravets

This comment has been minimized.

Member

ivankravets commented Nov 19, 2018

The issue was linked with duplicated config.h in Arduino framework which was in the first order in CPPPATH. Nevertheless, this is a bug, user's custom includes, project includes, and library dependencies should go first in list for C Preprocessor.

@atsteich

This comment has been minimized.

atsteich commented Nov 19, 2018

after upgrading everything works as expected, thanks!

@ivankravets ivankravets added this to the 3.6.2 milestone Nov 19, 2018

ivankravets added a commit that referenced this issue Nov 24, 2018

Merge branch 'develop' into feature/py3
* develop: (31 commits)
  Document "erase" target
  Docs: Grammar fixes
  Bump version to 3.6.2b5
  Improved IntelliSense for PlatformIO IDE for VSCode via passing extra compiler information for C/C++ Code Parser
  Bump version to 3.6.2b4
  LDF: Stop handling "define" and "undef" when condition fails; handle CPP files in "chain+" and "deep+" modes // Resolve #1930
  Bump version to 3.6.2b3
  Handle CWD when searching for a file // Resolve #1930
  Document in `library.json` how to pass flags to a global build environment
  Bump version to 3.6.2b2
  Fix an issue when Library Dependency Finder (LDF) finds spurious dependencies in ``chain+`` and ``deep+`` modes // Resolve #1930
  Fix an issue when Library Dependency Finder (LDF) does not handle project `src_filter ` // Resolve #1905
  Bump version to 3.6.2b1
  Prepend CPPATH of library dependencies instead of appending // Resolve #1914
  Bump version to 3.6.2a3
  Go over 8010-8100 TCP ports when shutting down PIO Home server
  Docs: Add support for OLIMEX ESP32-PRO
  Rename "System" to "Hardware" for board spec
  Add info about "EN" pin for ESP32 and debug probes
  Fix pinouts for oddWires IOT-Bus JTAG
  ...

# Conflicts:
#	platformio/__init__.py
#	platformio/managers/core.py

@ivankravets ivankravets referenced this issue Nov 29, 2018

Closed

platformio 3.6.2 #34596

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment