2

Im trying to import i2c into my rapsberry pi pico project.

add_library(ssd1306
    ssd1306.c
) 

target_link_libraries(ssd1306 pico_stdlib)
target_link_libraries(ssd1306 pico_stdlib )
target_link_libraries(ssd1306 pico_multicore)
target_link_libraries(ssd1306 hardware_i2c)

this is cmake im using for it(its in subdirectory) and everytime i try to run

 fatal error: hardware/i2c: No such file or directory
   27 | #include "hardware/i2c"
      |

include c code:

#include "hardware/i2c"

I tried:

   target_link_libraries(ssd1306 hardware)

Also <> instead of "" but didnt worket either
project ofc has pico_sdk_import.cmake which links all pico sdk libs

StiglCZ
  • 19
  • 1
  • 6

0 Answers0