undefined reference to `Wire' (using arduino-cli only)

37 views Asked by At

I'm running the arduino-cli to compile a file, and it fails, but in the IDE it works.

Can someone explain why the command line doesn't work but the IDE does? And how to get the command working?

arduino-cli compile --verbose --fqbn m5stack:esp32:m5stack_cardputer ./Launcher/Launcher.ino --output-dir ./support_files

and I get this issue:

/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o:(.literal._ZN4lgfx2v13i2c7setPinsEiii+0x0): undefined reference to `Wire1'
/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o:(.literal._ZN4lgfx2v13i2c7setPinsEiii+0x4): undefined reference to `Wire'
/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o:(.literal._ZN4lgfx2v13i2c7setPinsEiii+0x8): undefined reference to `TwoWire::setPins(int, int)'
/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o:(.literal._ZN4lgfx2v13i2c4initEi+0x0): undefined reference to `TwoWire::begin(int, int, unsigned int)'
/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o: in function `lgfx::v1::i2c::setPins(int, int, int)':
/Users/thomasreggi/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:1043: undefined reference to `TwoWire::setPins(int, int)'
/Users/thomasreggi/Library/Arduino15/packages/m5stack/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/78/kqwnjhw57nn1nkn3vyp1rp0c0000gn/T/arduino/sketches/7288F7CF9850CFB031E2F9F51CBBCA86/libraries/M5GFX/lgfx/v1/platforms/esp32/common.cpp.o: in function `TwoWire::begin()':
/Users/thomasreggi/Library/Arduino15/packages/m5stack/hardware/esp32/2.1.0/libraries/Wire/src/Wire.h:92: undefined reference to `TwoWire::begin(int, int, unsigned int)'
0

There are 0 answers