Having issues understanding the process on linking libraries. i've referred to many links and in particular this one How to properly use CMake in embedded (RP2040) project structure?
but have had just a hard time getting it to work or even see that the folder exists.
i've made it clear with include_directories but that doesnt seem to allow to see the folder
ERROR Eclipse pulls:Description Resource Path Location Type Invalid project path: Include path not found (C:\Users\andre\OneDrive\Documents\Pico\pico-examples-eclipse\test\src\MFRC522_NFC). test_project-Debug@test pathentry Path Entry Problem
Imgur link : Photos of directory and build
MAIN CMAKELISTS:
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE ON)
include(pico_sdk_import.cmake)
#command to set the project name & lanague used
project(test_project C CXX ASM)
#Directories
include_directories(src/MFRC522_NFC)
include_directories(src)
#SubDirectories
add_subdirectory(MFRC522_NFC)
#add_subdirectory(src)
#C features
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
#create an executable using the specified source code files.
add_executable(test
./src/main.c
)
pico_add_extra_outputs(test)
pico_enable_stdio_usb(test 1)
pico_enable_stdio_uart(test 0)
target_link_libraries( test
pico_stdlib
hardware_i2c
MFRC522_NFC
)
CMAKELISTS IN CUSTOM LIBRARY FOLDER:
cmake_minimum_required(VERSION 3.13)
project(MFRC522_NFC)
add_library(${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} ${PROJECT_SOURCE_DIR})
target_sources(${PROJECT_NAME}
PUBLIC
src/MFRC522_NFC/MFRC522.c
src/MFRC522_NFC/MFRC522.h
)
CMAKE OUTPUT LOG:
The target system is: PICO - - cortex-m0plus
The host system is: Windows - 10.0.22000 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin/arm-
none-eabi-gcc.exe
Build flags: ;-mcpu=cortex-m0plus;-mthumb
Id flags: -c
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced
"CMakeCCompilerId.o"
The C compiler identification is GNU, found in
"C:/Users/andre/OneDrive/Documents/Pico/pico-examples-
eclipse/test/CMakeFiles/3.20.6/CompilerIdC/CMakeCCompilerId.o"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp"
succeeded.
Compiler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin/arm-
none-eabi-g++.exe
Build flags: ;-mcpu=cortex-m0plus;-mthumb
Id flags: -c
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced
"CMakeCXXCompilerId.o"
The CXX compiler identification is GNU, found in
"C:/Users/andre/OneDrive/Documents/Pico/pico-examples-
eclipse/test/CMakeFiles/3.20.6/CompilerIdCXX/CMakeCXXCompilerId.o"
Checking whether the ASM compiler is GNU using "--version" matched "(GNU assembler)|
(GCC)|(Free Software Foundation)":
arm-none-eabi-gcc.exe (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.16))
11.2.1 20220111
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
CMAKE ERROR LOG:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin/arm-
none-eabi-gcc.exe
Build flags: ;-mcpu=cortex-m0plus;-mthumb
Id flags:
The output was:
1
c:/program files (x86)/arm gnu toolchain arm-none-eabi/11.2 2022.02/bin/../lib/gcc/arm-
none-eabi/11.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/program files (x86)/arm gnu
toolchain arm-none-eabi/11.2 2022.02/bin/../lib/gcc/arm-none-eabi/11.2.1/thumb/v6-
m/nofp\libc.a(lib_a-exit.o): in function `exit':
/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-
cygwin/newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin/arm-
none-eabi-g++.exe
Build flags: ;-mcpu=cortex-m0plus;-mthumb
Id flags:
The output was:
1
c:/program files (x86)/arm gnu toolchain arm-none-eabi/11.2 2022.02/bin/../lib/gcc/arm-
none-eabi/11.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/program files (x86)/arm gnu
toolchain arm-none-eabi/11.2 2022.02/bin/../lib/gcc/arm-none-eabi/11.2.1/thumb/v6-
m/nofp\libc.a(lib_a-exit.o): in function `exit':
/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-
cygwin/newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status