PicoLED icon indicating copy to clipboard operation
PicoLED copied to clipboard

Error when adding to existing C project.

Open anand-010 opened this issue 1 year ago • 3 comments

i am tring to implement ws2812 to an existing c project. but i've got error like this.

fatal error: stdexcept: No such file or directory [build] 4 | #include same for cmath, map.

this is my CmakeLists.txt

cmake_minimum_required(VERSION 3.13)
add_subdirectory(./pico-mpr121/lib mpr121)
include(/home/anand/Desktop/pico-sdk/pico_sdk_init.cmake)
include(pico_sdk_import.cmake)
project(Actuator C CXX ASM)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(PICO_CXX_ENABLE_EXCEPTIONS 1)
set(PICO_CXX_ENABLE_RTTI 1)
# initialize the Raspberry Pi Pico SDK
pico_sdk_init()
include(example_auto_set_url.cmake)
include(${CMAKE_HOME_DIRECTORY}/PicoLED/PicoLed.cmake)

FILE(GLOB  MyCSources *.c)
ADD_EXECUTABLE(Actuator ${MyCSources})

# pull in common dependencies
target_link_libraries(Actuator pico_stdlib hardware_uart  hardware_i2c pico-mpr121 PicoLed hardware_pio)

pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 0)
# create map/bin/hex file etc.
pico_add_extra_outputs(Actuator)

how do i solve this?.

anand-010 avatar Mar 28 '23 09:03 anand-010

Hi, have you found any solution for your problem?

akycdi avatar Jul 31 '23 06:07 akycdi

I'm interested in a solution as well.

Roming22 avatar Aug 05 '23 17:08 Roming22

Probably cause these includes are part of c++ standard libraries and would only work with .cpp files

AshwinGinoria avatar May 06 '24 03:05 AshwinGinoria