Thanks for the fast response. Modified platformio.ini: platformio libextradirs = “/Users/me/Documents/ComputerScience/ARDUINODEVELOPMENT/libraries” common libdepsexternal = AdafruitNeoPixel, U8glibmizraith env:nanoatmega328 buildflags = -D DEBUGMODE=1 -D USENEOPIXELLEDS -D USEU8GLIBGRAPHICS -Wno-unknown-pragmas libldfmode = chain+ platform = atmelavr board = nanoatmega328 framework = arduino Ran PLATFORMIOREBUILDPROJECTINDEX and re-ran but now it is having trouble with the include “U8glib.h” file.
CMake Project Structure; Properties and Options; Currently, the files of our little CMake project are all in the same directory. Sources for the main program, sources for the tests, the Catch header, the CMakeLists.txt – everything. I’ve written about structuring our code into directories, and today we’ll move our project in that direction.
The structure of the external library is: /Users/me/Documents/ComputerScience/ARDUINODEVELOPMENT/libraries/U8glibmizraith/U8glib.h. Is there a better way to specify the include so that it looks under “U8glibmizraith” for the U8glib.h file? Then I ran the platformio init -ide clion -board due -board megaatmega2560 -board nanoatmega328 command and was pleasantly surprised that it did not clobber my existing platformio.ini file. Still the same problem with U8glib.h as before. Not showing up in the dependency graph.
Library Dependency Graph - EPROM v2.0 - SPI v1.0. So the quotes around the libextradirs was evil?
Removing that helped! Now I get: Collected 57 compatible libraries Looking for dependencies.
Library Dependency Graph - v2.0 - - - - v1.0 - - - v1.0 - v1.0 - v1.0 - v1.0.0 - v1.0 Which isn’t quite right (I should see the SSD1306 with the include guards. So I reinstated libldfmode = chain+ and with the preprocessor #ifdef’s, I now get the more correct (and less resource intensive): Library Dependency Graph - v2.0 - - - v1.0 I’m still seeing the linking issue with the PPCmain.h file. This may be my problem (with my include structure) and I will look into that.
Okay - i figured it out. Again, thanks for your awesome help. Turns out I had one main file in /src: myapplication.cpp And I had put all my other files under /lib mymainincludefile.h myotherheaders.h myothersources.cpp The idea was that inside myapplication.cpp there was a single include #include 'mymainincludefile.h' Inside that include was a list of #include for all the other headers in /lib. But platformIO couldn’t compile with the above include so I tried: #include './lib/mymainincludefile.h' This worked, but didn’t link.
(1) Is there a way to get this to link up? Can I add /lib as a directory to scan for sources?
So, I copied all my source files from /lib into /src and removed the file path from my #include. And voila – EVERYTHING COMPILED!!!
Ivan, Not sure I completely follow. I read the LDF docs closely, multiple times. The first issue (that paths must not have quotes) is never explicitly stated in the docs.
What about paths with spaces? I went with the default (both Windows/Mac) and quoted my path. The second issue, using /lib was surprising. From the docs, it appears LDF looks in /lib, and I had set the chain+ option.
Why wouldn’t LDF have included the rest of the files linked by my.h? I’m not knocking your support (which has been excellent), but having read the docs over multiple times, catching the little non-standard differences was difficult and time consuming. That said, not sure there would have been anyway to catch these issues (unless PIO had improved syntax checking for the platformio.ini file).
And that’s why your support has been so critical to get me up and running.
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK.
CMake is part of Kitware’s collection of commercially supported for software development.