I hope this the correct category for this topic
I am trying to use googleTest in native mode and have hit a strange problem.
I have a ‘library’ project that I am including in my main project via a lib_deps symlink
One of my ‘library’ files includes uECC.h which is part of kmackay/micro-ecc@^1.0.0 - also included via lib_deps
when I run tests natively I get the following compile error
Building...
/home/hangstrap/dry_living/code/foursee-utils/src/4c_encription.cpp:1:10: fatal error: uECC.h: No such file or directory
1 | #include <uECC.h>
| ^~~~~~~~
compilation terminated.
*** [.pio/build/native/lib42f/foursee-utils/4c_encription.o] Error 1
which is odd as I can see the file under .pio/libdeps/native/micro-ecc/uECC.h
I can build the project as a normal arduino environment as per expected.
Thanks for helping
Richard
Found this in the very verbose compile log
Framework incompatible library /home/hangstrap/dry_living/code/dry-library/.pio/libdeps/native/micro-ecc
More details about "Library Compatibility Mode": https://docs.platformio.org/page/librarymanager/ldf.html#ldf-compat-mode
Is there a work around?
adding the following to the platformio.ini stopped the error
lib_ldf_mode = deep+
lib_compat_mode = off
I would love to know why I didn’t have this problem with the ‘library’ project but only with the project that used the ‘library’ project
https://registry.platformio.org/libraries/kmackay/micro-ecc/compatibility declares compatibilty with the Arduino framework, since it has a library.properties file. This will fail to be included for platform = native
which has no framework set.
PlatformIO cannot determine that the compatibility setting for this library should actually be “any platform, any framework (also ‘no framework’)”. That’s why lib_compat_mode
is necessary there.
You can also fork the library and give it a proper library.json.