Error compiling because of missing lib, which is here!

Hello!
I’m not sure if i found an error, but it looks like a bug:
I installed the dcf-library (along with others) globally. Everything looks fine, as you can see at the top of the picture.

Everything looks fine. But whern i try to build the project, it fails! Looking at the error-message, the library-path is completely struggled:
Middle of the picture.

The global library-path is ~/.platformio/lib/dcf77_xtal_ID1482
I dont use any private lib.
What happens here? If i put the lib in the project-folder/lib, it compiles. But this is not wished nor do i want to do that, even when the library-manager tells me to do that:
Bottom of the picture:


That sound extremely strong to me, with lots of projects i will have multiple lib-copies with different versions, which i don’t want! I prefer change my code when a lib evolves!
So is it a bug?
I’d like NOT to edit the platformio.ini inside the project-folder to add whatever globally installed lib.
Or is there anything else i have done wrong? The Library-help doesnt help me much.
I am using the latest platformio 4.4.0.4, even when the app tells 4.4.0.3. I’m using with vscode on osx 10.15.5
“You’re up-to-date!
PlatformIO 4.4.0a4 is currently the newest version available.”
Any help is appreciated!

Not reproducable.

First try to rebuild the IntelliSense.

Then execute the Clean project task and open a PIO terminal. Then execute

pio run -v 2>&1 >> compile_log.txt

to get a verbose compile log file. Upload to https://pastebin.com/ and post the link.

Having multiple copies of library for multiple projects is actually a good thing. You’ll be able to update the versions independently then. One project won’t be broken because of upgrading library version in another one.
I had a project for Arduino Uno which wouldn’t fit into flash with the latest version of a library, so I had to use previous one…

ok, here we go!
first compiling before rebuild/clean/run:

Second compile after rebuild/clean/run (without symlinked libs to project-folder):

Hope, that helps!
And many thanks for your help! :slight_smile:

So, compilation is successful in every log.

There are no errors, only warnings coming from the code of the libraries from unused stuff. Like

dcf77_xtal_ID1482/dcf77.h:734:30: warning: typedef 'assert_type_is_known' locally defined but not used [-Wunused-local-typedefs]

If you want those fixed, hit up the guy who initially wrote the code that produces these warnings (Issues · udoklein/dcf77 · GitHub) or fork a fixed version yourself.

You don’t get these errors anymore in the second run because the files are not recompiled anymore (PlatformIO caches the compilation result). That had nothing to do with linking the libraries wie ln -s.

Side note: You are using the framework-arduino-avr-minicore (GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB) variant of the Arduino AVR core (framework-arduino-avr) because you specified board = ATmega328P. That shouldn’t cause any problems however, just be aware of it.

So if you remove all symlink hacks, remove any locally installed library in the lib/ folder of the project and keep the global one ~/.platformio/lib, and you rebuild the Intellisense within VSCode, does the project still compile and not show any path errors in the UI?

Thank you very much for your help! Its good to know that there is a caching of the compile thing. I have noted that sometimes i get errors, but on a second run (mostly after fixing errors which i made) there are no more errors, even when i didnt fix anything.
The only thing i would know, if there is a global setting regarding the use of libs. I didnt find anything. The help is somewhat strange for me to understand… And i never found any kind of config-file like for other things.
The minicore is used, because i dont use boards like uno or others. I program the bare metal chip and make my own boards. So i get more freedom…
So thanks again for your kind help and have good days!!!