Skip to content

Error Compilation ESP-IDF 5.3.1Β #32

@hmaLiiAtech

Description

@hmaLiiAtech

Hi,
I use Linux Ubuntu & ESP-IDF 5.3.1
I get error when build :

/home/liia/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/main/libmain.a(main.cpp.obj):(.literal.app_main+0x84): undefined reference to sqlite3_open' /home/liia/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/main/libmain.a(main.cpp.obj): in function app_main':
/home/liia/sac_nw_v10/main/main.cpp:238:(.text.app_main+0x1e8): undefined reference to `sqlite3_open'

Code πŸ‘

#include <stdio.h>
#include "sqlite3.h"

extern "C" void app_main(void) {
sqlite3 *db;
int rc = sqlite3_open(":memory:", &db);
if (rc) {
printf("Can't open database: %s\n", sqlite3_errmsg(db));
} else {
printf("Opened database successfully\n");
}
sqlite3_close(db);
}

sqlite3.h is a component in the folder components/sqlite

CMakeLists.txt : (in the sqlite)

set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ".")
set(COMPONENT_REQUIRES console spi_flash esp_partition esp_timer spiffs json)
register_component()

CMakeLists.txt (in main)

set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ".")

register_component()

this configuration works in V4.4.6.
it was used but on mac OSX.

thanks for your support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions