-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Don't understand how /lib in the project folder works??? #273
Comments
Please read info in documentation http://docs.platformio.org/en/latest/projectconf.html#lib-dir
PlatformIO Library Manager uses own external folder ( |
I still don't follow as when I use the PlatformIO Library Manager it doesn't put anything in the /lib folder at all. Just to be clear, this is the /lib folder that is created next to the /src folder. If I put any .h / .cpp files in that /lib folder then neither PlatformIO or Eclipse is aware of them. Yes, when I use PlatformIO Library Manager it creates the libraries under ~/.platformio folder but they are not added to Eclipse so you get lots of CODAN errors and it doesn't update the includes used. Overall, I don't see how using PlatformIO Library Manager helps when using Eclipse... as such, I'm not using it as it doesn't help, it only hinders and was hoping you had better examples or information on this. |
Please read
Give me please an output of this command:
|
I still don't follow why my project .\lib folder is empty - what is the point of that...?? So the only benefit is that I create another folder within it, private_lib/ and then put in source files??? Why the extra folder for no reason. It is empty and all the source files from 3rd party libraries that PlatformIO Library Manager downloads are created in the libraries under ~/.platformio folder ??
Despite all that, there is no update the any Eclipse project files... so how does the Eclipse project know about all the /lib folder... either via PlatformIO Library Manager or the /lib/private_lib folder? |
Here is my projects' folders... I'm not sure if we're talking about the same /lib folder... I mean the one in this directory listing below... NOT the lib folder at ~/.platformio
|
See
Yes, because all libraries from PlatformIO Library Manager are visible for all PlatformIO-based project in your system, If you need specific/private/isolated library per project, please use |
ok, I finally seem to have got what is going on... and Eclipse is working. Initially things were getting mixed up with old source files etc.... thanks for persisting with me on this. I think the docs are little vague on all this and could use a strong set of examples or tutorial on how you'd use it with Eclipse etc.... I got there eventually, but it wasn't clear what was going wrong etc. G |
Sorry - thought this was sorted but it isn't.... I've dropped a few custom .H .CPP files into the projects /lib folder and Eclipse is fine with finding them. PlatformIO cannot find them, so I can only assume that whilst it creates the /lib folder on project creation, it won't use it as a search path for source files. That seems odd and I don't follow why that would be? Why create a folder that isn't used? Oh, and what do I have to do to PlatformIO to tell it to include the /lib folder in my project directory? And why isn't this enabled by default if the /lib folder is created? |
ok, figured it out... I needed to put my lib files into /lib/private_lib and then platformio found them!! That isn't clear and you should probably consider having platformio init create that folder too... what's the point of the /lib folder in the project if you can't drop in the files unless they are in the private_lib folder??? I worked it out by trial and error and none of the documentation says to do that step. It talks about adding private_lib to the %lib_dir% folder, but that's not the projects lib folder. Thats two different locations. |
PlatformIO uses own source code builder. Eclipse is used just for syntax highlighting, code navigation and autocomplete. When you build project via Eclipse using PlatformIO, Eclipse delegates all control to PlatformIO. Don't afraid if Eclipse highlights that something is wrong. You should relay upon PlatformIO console output. |
Please don't close this issue. I'll add this information to documentation. Thanks! 🍺 |
Yeah, well I personally think the issue isn't just documentation - I still don't get why the /lib folder is even created alongside the /src folder if you cannot use it without putting things inside the private_lib folder? All that doesn't make sense and I'm not sure why you wouldn't consider having platformio init create that folder too... how else can you use the lib folder? Does everything need to be in a folder before it is included? |
The
|
Also, added |
@SimonRydell try to remove spaces in |
Configuration Operating system: Mac OS 10.11.4 PlatformIO Version 2.10.1 IDE Atom with PlatformIO Version 1.2.2 Description of problem I'm sorry for this incredibly newbie question, but I haven't gotten any of the libraries I installed via PlatformIO to work. whenever I use for example "#include < ESP8266.h >" , I only get the following error:
Do I have to do anything more than just "pio lib install 127" in the commandline to be able to use the libraries? I include the result from writing "pio lib list" below;
|
[Thu Jun 16 23:05:38 2016] Processing nodemcuv2 (platform: espressif, board: nodemcuv2, framework: arduino) xtensa-lx106-elf-g++ -o .pioenvs/nodemcuv2/src/main.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-sect ^ PlatformIO: BuildFile 3Project 88 Issuessrc/main.cpp22:11 |
Do you have |
I removed it while trying to debug. Sorry, here comes the error produced with it [Thu Jun 16 23:18:29 2016] Processing nodemcuv2 (platform: espressif, board: nodemcuv2, framework: arduino) xtensa-lx106-elf-g++ -o .pioenvs/nodemcuv2/src/main.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-sect |
The code I'm trying to upload: `#include "Arduino.h" ESP8266 wifi(Serial1); void setup(void)
} void loop(void) |
What do you want to do? You are going to use library that is written for Atmel AVR development platform where you use This library http://platformio.org/lib/show/127/ESP8266 is intended to be used as Master (AVR) that will communicate with ESP8266 via UART. |
Please uninstall 127 library and take a look at these examples: https://github.com/esp8266/Arduino/tree/master/libraries These are the native examples for your Node MCU |
Oh, I see. I'm sorry, I'm new to this. So I can only use libraries which use the platform |
@SimonRydell be careful with "Compatibility" field near each library. |
"lib/private_lib/[here are source files]" structure for project related private library DOES NOT work I've tried every possibility . impossible. If I copy beside main.cpp it is working but in lib/MyLib OR lib/src/MyLib.h .cpp unreachable !! |
@trevor-sonic see examples in README.txt file that is located in |
@ivankravets I am trying include Orbit_Oled_Library.zip to my project which has a dir structure like this
How should I group the files so that I can use this library in my #include "Launchpad.h"
#include "OrbitChar.h" the compiler is not able to find these header files because they have been moved to a different directory. What should I do? Thanks a lot |
You should put all files. |
@ivankravets thanks for your reply 😄 so I put all files in one single directory and I can name it whatever I want? |
Please check http://docs.platformio.org/en/stable/userguide/lib/cmd_install.html You can install library directly from ZIP archive. |
Hello, |
@Hamza5 which library do you install? |
@ivankravets I attached a screenshot of my current setup (returned to the first one) : |
@Hamza5 Menu > PlatformIO > Rebuild C/C++ Index? |
Wow finally it worked ! 😄 I tried to rebuild the index many times but it failed, but now It worked, and I figured out why : previously I opened a parent directory ( |
Unix has case sensitive file system |
Thank you! Totally forgot about this. |
Hi! I have a question I can't figure out the answer to. I have multiple libraries in the /lib folder but some of them depend on each other. How do I go about linking them? Ex:
In Foo.h, I need #include Bar.H |
Hi Abrishek (@Riz-waan), please forward your question to https://community.platformio.org/ |
When I've created a new project, there is a /src and /lib folder, but cannot follow how you are supposed to the use the /lib folder.
In Eclipse, if you place source files in the /lib folder, they are not configured to be used. Also, when you use the Library Manager, it adds the files to the ~/.platformio folder but that doesn't use the /lib folder either... so what gives???
The text was updated successfully, but these errors were encountered: