Error collect2 ld returned 1 exit status là gì năm 2024
Answers checklist.
IDF version.v4.4.4 Show
Operating System used.macOS How did you build your project?Command line with idf.py If you are using Windows, please specify command line type.None What is the expected behavior?I expect the project to build What is the actual behavior?I get ld link errors Steps to reproduce../CMakeLists.txtThe following lines of boilerplate have to be in your project'sCMakeLists in this exact order for cmake to work correctlycmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(EXTRA_COMPONENT_DIRS )
project(vsl)./hw/main/CMakeLists.txtset(requires blemesh_console fatfs) set(CMAKE_EXE_LINKER_FLAGS "-Wl -t") idf_component_register( )./hw/components/blemesh_console/CMakeLists.txtset(srcs "ble_mesh_adapter.c" set(requires ble_mesh_init)
set(priv_requires nvs_flash bt console fatfs)
idf_component_register(SRCS "${srcs}"
// ./hw/components/blemesh_console/ble_mesh_console_decl.h
/* Console example — declarations of command registration functions.This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ pragma onceinclude "esp_ble_mesh_defs.h"// Register system functions void register_system(void); // Register blutooth void register_bluetooth(void); // Register mesh node cmd void ble_mesh_register_mesh_node(void); // Register Test Perf client cmd void ble_mesh_register_mesh_test_performance_client(void); if (CONFIG_BLE_MESH_CFG_CLI)// Register mesh config client operation cmd void ble_mesh_register_configuration_client_model(void); endif// Register mesh config server and generic server operation cmd void ble_mesh_register_server(void); if (CONFIG_BLE_MESH_GENERIC_ONOFF_CLI)// Register mesh client operation cmd void ble_mesh_register_gen_onoff_client(void); endifif (CONFIG_BLE_MESH_CFG_CLI)// Register mesh config client operation cmd void ble_mesh_register_configuration_client_model(void); endif// ./hw/main/main.cpp include
include "sdkconfig.h"include "sdkconfig.h"include "freertos/FreeRTOS.h"include "freertos/portmacro.h"include "freertos/task.h"include "esp_system.h"include "esp_spi_flash.h"// https://github.com/espressif/rust-esp32-example/pull/47 include "esp_flash.h"include "esp_chip_info.h"include "FreeRTOSConfig.h"include "driver/gpio.h"include "FreeRTOSConfig.h"include "esp_log.h"include "esp_vfs_dev.h"include "nvs.h"include "nvs_flash.h"include "esp_vfs_fat.h"include "esp_console.h"include "ble_mesh_console_decl.h"include "ble_mesh_init.h"// Enabling C++ compile extern "C" { }
void app_main(void)
{
if (CONFIG_BLE_MESH_GENERIC_ONOFF_CLI)
ble_mesh_register_gen_onoff_client();
endifif (CONFIG_BLE_MESH_CFG_CLI)
ble_mesh_register_configuration_client_model();
endifprintf("!!!ready!!!\n");
// start console REPL
ESP_ERROR_CHECK(esp_console_start_repl(repl));
while (true)
{
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
|