I would add your new library as an interface library using the CMakeLists.txt in that directory. Likely the linker cannot find your new files. It would help if you posted your CMakeLists.txt and what #include are in each source and header file. Also the cmake console output with errors.
To add the interface library named test, with target includes, in CMakeLists.txt:
To add the interface library named test, with target includes, in CMakeLists.txt:
Code:
# CMakeLists.txt in the source dir# Define an INTERFACE library named 'test'add_library(test INTERFACE)# Add the source file test.c to the test interfacetarget_sources(test INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/test.c)# Add the current source directory to the include path for testtarget_include_directories(test INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})# Link necessary libraries to the test interfacetarget_link_libraries(test INTERFACE pico_stdlib)
Statistics: Posted by breaker — Tue Nov 12, 2024 4:34 pm