Skip to content
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

Cannot Locate External Library Dependency #4248

Open
PrestonBodak opened this issue Feb 5, 2025 · 0 comments
Open

Cannot Locate External Library Dependency #4248

PrestonBodak opened this issue Feb 5, 2025 · 0 comments

Comments

@PrestonBodak
Copy link

I am currently using PlatformIO via VS Code and microros to develop an application that uses an MPU6050 sensor with a Teensy 4.1 board, and I'm using this library to interface with it. I am able to successfully run one of the examples for the library, but when incorporating it into my own code, I receive the following error upon building:

In file included from .pio/libdeps/teensy41/MPU6050/src/I2Cdev.cpp:49:
.pio/libdeps/teensy41/MPU6050/src/I2Cdev.h:94:18: fatal error: Wire.h: No such file or directory

**************************************************************
* Looking for Wire.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Wire.h"
* Web  > https://registry.platformio.org/search?q=header:Wire.h
*
**************************************************************

   94 |         #include <Wire.h>
      |                  ^~~~~~~~
Compiling .pio/build/teensy41/libd65/MPU6050/MPU6050.cpp.o
compilation terminated.
*** [.pio/build/teensy41/libd65/MPU6050/I2Cdev.cpp.o] Error 1

I suspect this to be an issue with my PlatformIO installation or library configuration. My platformio.ini is as follows:

[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_distro = humble
board_microros_transport = native_ethernet
lib_deps = 
	Wire
	http://github.com/micro-ROS/micro_ros_platformio
	https://github.com/juliandesvignes/FreeRTOS-Teensy4.git
	https://github.com/ElectronicCats/mpu6050.git
lib_ldf_mode = deep+

I have also tried to use the lib_extra_dirs configuration to directly point to the folder containing Wire.h in my framework files, which still produced the same error. Additionally, adding #import <Wire.h> and even putting the Wire.h associated files in the library folder itself does not fix the issue either.

When trying to use the PlatformIO CLI tools (or any command that uses pio) to explore the issue, I receive the following error message:

Traceback (most recent call last):
  File "/usr/bin/pio", line 33, in <module>
    sys.exit(load_entry_point('platformio==4.3.4', 'console_scripts', 'pio')())
  File "/usr/bin/pio", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/platformio/__main__.py", line 66, in <module>
    @cli.resultcallback()
AttributeError: 'PlatformioCLI' object has no attribute 'resultcallback'. Did you mean: 'result_callback'?

I have attempted to re-run the installer script with curl as seen here, since it says it can also be used to upgrade your installation of PlatformIO, which did not fix the issue either. Any suggestions?

If relevant, my code can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant