Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5014

Troubleshooting • Compilation issue in VS code bugging me for so long

$
0
0
I have recently installed raspberry pi extension in VS code for easy of compilation, I done my project in vs code by installing cmake, python all the tool chain available, it used to break many time which makes me distracted from project when pico extension was announced I was so happy as things were going smoothe then came one issue, which I am not able to resolve.

Coming to the issue I am getting this

Code:

D:/Projects/pico projects/env-sen/env-sen.cpp:93:(.text.startup.main+0x14a): undefined reference to `set_mode(unsigned char)'
this usually comes when the function doesn't present in the scope, I have included it in the header too, which is present in

Code:

acc1
folder.
folder tree image :- https://imagebin.ca/v/8PdgHILBKwPY

Code:

uint8_t who_am_i();uint8_t set_mode(uint8_t value);uint8_t read_mode();uint8_t set_dynamic_range(uint8_t value);uint16_t read_accDataX();uint16_t read_accDataY();uint16_t read_accDataZ();float raw_convertor(uint16_t rawData);// float mma8451_convert_accel(uint16_t raw_accel);
I had also included the file in cmakelists.txt file

Code:

# Generated Cmake Pico project filecmake_minimum_required(VERSION 3.13)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)set(CMAKE_EXPORT_COMPILE_COMMANDS ON)# Initialise pico_sdk from installed location# (note this can come from environment, CMake cache etc)# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==if(WIN32)    set(USERHOME $ENV{USERPROFILE})else()    set(USERHOME $ENV{HOME})endif()set(sdkVersion 2.0.0)set(toolchainVersion 13_2_Rel1)set(picotoolVersion 2.0.0)set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)if (EXISTS ${picoVscode})    include(${picoVscode})endif()# ====================================================================================set(PICO_BOARD pico CACHE STRING "Board type")# Pull in Raspberry Pi Pico SDK (must be before project)include(pico_sdk_import.cmake)project(env-sen C CXX ASM)# Initialise the Raspberry Pi Pico SDKpico_sdk_init()# Add executable. Default name is the project name, version 0.1add_executable(env-sen env-sen.cpp                sx126x/sx126x.c sx126x/sx126x_hal.c sx126x/lora.cpp               pico-ssd1306/ssd1306.cpp pico-ssd1306/textRenderer/TextRenderer.cpp                pico-ssd1306/frameBuffer/FrameBuffer.cpp               bme68x/bme68x_hal.cpp bme68x/bme68x.c                acc1/acc.c)pico_set_program_name(env-sen "env-sen")pico_set_program_version(env-sen "0.1")# Modify the below lines to enable/disable output over UART/USBpico_enable_stdio_uart(env-sen 0)pico_enable_stdio_usb(env-sen 1)# Add the standard library to the buildtarget_link_libraries(env-sen        pico_stdlib testt)# Add the standard include files to the buildtarget_include_directories(env-sen PRIVATE  ${CMAKE_CURRENT_LIST_DIR}  ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required)# Add any user requested librariestarget_link_libraries(env-sen         hardware_spi        hardware_i2c        )pico_add_extra_outputs(env-sen)
can someone guide me how to resolve this, I am not getting this for other files. But I am getting when I am creating new files too.

Statistics: Posted by thunderbolt2_o — Tue Dec 10, 2024 3:22 pm — Replies 0 — Views 22



Viewing all articles
Browse latest Browse all 5014

Trending Articles