how about adding the include path -I in .cdef file?
Or you can copy the .h file together with the .c file?
I never tried so. What does it look like in .cdef?
this is how my .cdef looks:
sources:
{
testsql.c
}
And did you mean copy sqlite.h to testsql.c file?
------------------------update ----------------------------------
fatal error: lib/sqlite3.h: No such file or directory is gone now, but another error pops(something wrong with sqlite.so file I guess?):
(lsh:wp76_r9_toolchain) mangoh@mangoh-vm:~/Desktop/myWorkspace/sqlTest$ mkapp -t wp76 sqlTest.adef -i â$LEGATO_ROOT/third-party/inc/â -L â$LEGATO_ROOT/third-party/lib/sqlite3.soâ
** WARNING: Failed to receive sysroot path from compiler âgcc --print-sysrootâ (errno: Success).
[1/6] Linking C library
FAILED: _build_sqlTest/wp76/staging/read-only/lib/libComponent_testsqlComp.so
gcc -shared -o _build_sqlTest/wp76/staging/read-only/lib/libComponent_testsqlComp.so _build_sqlTest/wp76/component/e2fbebc6625ee95f1e4f2e1aff635082/obj/9e6743bd8c76fa5ac2d847a94fa75154.o _build_sqlTest/wp76/component/e2fbebc6625ee95f1e4f2e1aff635082/obj/_componentMain.c.o /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so -L_build_sqlTest/wp76/staging/read-only/lib -Wl,âenable-new-dtags,-rpath=â$ORIGIN/âŚ/libâ â-L$LEGATO_BUILD/framework/libâ -llegato -lpthread -lrt -lm
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/home/mangoh/Desktop/myWorkspace/leaf-data/wp76_r9_toolchain/wp76-legato/third-party/lib/sqlite3.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
can you attach your sqlTest project and 3rd party library here?
Ok, now Iâm getting this error:
/Workspace/mangOH/apps/sqliteApp/_build_sqliteApp/wp77xx/component/c87ee7b719a19be1a70e5dfce1d0b4b1/obj/libComponent_sqliteTest.so: undefined reference to `sqlite3_openâ
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Did you compile the sqlite3.so?
yes I did. Just to clarify, should be compiling the app with the wp77xx toolchain or the wp76 toolchain?
thatâs something I cannot help so far⌠Iâm stuck too
I can compile with attached application.
The makefile of sqlite is using WP76 R9 toolchain.
The legato application is successfully compiled in WP76 R10.1.
testsql.7z (2.8 MB)
Hi,
I directly used .so file in your attach, but still got this:
(lsh:wp76_r9_toolchain) mangoh@mangoh-vm:~/Desktop/myWorkspace/sqlTest$ mkapp -t wp76 sqlTest.adef -i âthird-party/incâ -L âthird-party/lib/sqlite3.soâ
** WARNING: Failed to receive sysroot path from compiler âgcc --print-sysrootâ (errno: Success).
[3/9] Linking C library
FAILED: _build_sqlTest/wp76/staging/read-only/lib/libComponent_testsqlComp.so
gcc -shared -o _build_sqlTest/wp76/staging/read-only/lib/libComponent_testsqlComp.so _build_sqlTest/wp76/component/e2fbebc6625ee95f1e4f2e1aff635082/obj/9e6743bd8c76fa5ac2d847a94fa75154.o _build_sqlTest/wp76/component/e2fbebc6625ee95f1e4f2e1aff635082/obj/_componentMain.c.o third-party/lib/sqlite3.so -lsqlite3 -L_build_sqlTest/wp76/staging/read-only/lib -Wl,âenable-new-dtags,-rpath=â$ORIGIN/âŚ/libâ â-L$LEGATO_BUILD/framework/libâ -llegato -lpthread -lrt -lm
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/sqlite3.so: Relocations in generic ELF (EM: 40)
third-party/lib/sqlite3.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
[4/9] Compiling C source
ninja: build stopped: subcommand failed.
Are you using my project for legato app?
I tried with your app also, it produced the same error thoâŚ
I am not using third-party/lib/sqlite3.so.
I used libsqlite3.so
Seems you are not using the same as mine
This is the error produced by your app on my machine:
(lsh:wp76_r9_toolchain) mangoh@mangoh-vm:~/Desktop/myWorkspace/testsql$ mkapp -t wp76 testsql.adef -i âthird-party/incâ -L âthird-party/lib/libsqlite3.soâ
** WARNING: Failed to receive sysroot path from compiler âgcc --print-sysrootâ (errno: Success).
[4/9] Linking C library
FAILED: _build_testsql/wp76/staging/read-only/lib/libComponent_testsqlComponent.so
gcc -shared -o _build_testsql/wp76/staging/read-only/lib/libComponent_testsqlComponent.so _build_testsql/wp76/component/8e66693676fcd15060ca87bf2fcf29b4/obj/c06d414e5250101e4956254547f2c639.o _build_testsql/wp76/component/8e66693676fcd15060ca87bf2fcf29b4/obj/_componentMain.c.o third-party/lib/libsqlite3.so -L/home/mangoh/Desktop/myWorkspace/testsql/third-party/lib -lsqlite3 -L_build_testsql/wp76/staging/read-only/lib -Wl,âenable-new-dtags,-rpath=â$ORIGIN/âŚ/libâ â-L$LEGATO_BUILD/framework/libâ -llegato -lpthread -lrt -lm
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
/usr/bin/ld: third-party/lib/libsqlite3.so: Relocations in generic ELF (EM: 40)
third-party/lib/libsqlite3.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Have you done a âmake cleanâ?
Or you need to recompile libsqlite3.so with your wp76 r9 toolchain?
This is so weirdâŚ
(lsh:wp76_r9_toolchain) mangoh@mangoh-vm:~/Desktop/myWorkspace/testsql/third-party/src$ make -f Makefile clean
make: *** No rule to make target âcleanâ. Stop.
(lsh:wp76_r9_toolchain) mangoh@mangoh-vm:~/Desktop/myWorkspace/testsql/third-party/src$ make clean
make: *** No rule to make target âcleanâ. Stop.
I tried recompile libsqlite3.so, it didnât make a differenceâŚ
I mean make clean the legato projectâŚ
I successfully compile the legato app with developer studio with wp76 r10.1 package, maybe you can try the same.
I seem to have it working now. Thanks for your help. Iâm wondering if there is a way to put an already existing .db file onto the mangoh and access it through sqlite3?
I guess you need to bundle the database in .adef.
You can see here on how to open database:
Did you have it working on wp7702?
Iâm still stuck⌠Can you specify how you did it?
now Iâm getting thisâŚ
(lsh:SWI-WP76) ubuntu@ubuntu1804:~/Desktop/myWorkspace/testsql$ mkapp -t wp76xx testsql.adef -i âthird-party/incâ -L âthird-party/lib/libsqlite3.soâ
[5/10] Linking C library
FAILED: _build_testsql/wp76xx/staging/read-only/lib/libComponent_testsqlComponent.so
/home/ubuntu/Desktop/myWorkspace/leaf-data/SWI-WP76/wp76-toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/ubuntu/Desktop/myWorkspace/leaf-data/SWI-WP76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi -shared -o _build_testsql/wp76xx/staging/read-only/lib/libComponent_testsqlComponent.so _build_testsql/wp76xx/component/d6489c1101c4ed5fdff50b8faa2fbc1c/obj/87454c5c98951df982e27e716134b07f.o _build_testsql/wp76xx/component/d6489c1101c4ed5fdff50b8faa2fbc1c/obj/_componentMain.c.o third-party/lib/libsqlite3.so -L/home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib -lsqlite3 -L_build_testsql/wp76xx/staging/read-only/lib -Wl,âenable-new-dtags,-rpath=â$ORIGIN/âŚ/libâ â-L$LEGATO_BUILD/framework/libâ -llegato -lpthread -lrt -lm
/home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so:(.rodata+0x24): multiple definition ofsqlite3_version' third-party/lib/libsqlite3.so:(.rodata+0x24): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so:(.bss+0x0): multiple definition of
sqlite3_temp_directoryâ
third-party/lib/libsqlite3.so:(.bss+0x0): first defined here
/home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so:(.bss+0x4): multiple definition ofsqlite3_data_directory' third-party/lib/libsqlite3.so:(.bss+0x4): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_status64â:
sqlite3.c:(.text+0x1ec): multiple definition ofsqlite3_status64' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x1ec): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_mutex_enterâ:
sqlite3.c:(.text+0x5120): multiple definition ofsqlite3_mutex_enter' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x5120): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_mutex_leaveâ:
sqlite3.c:(.text+0x51b4): multiple definition ofsqlite3_mutex_leave' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x51b4): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_statusâ:
sqlite3.c:(.text+0x30c): multiple definition ofsqlite3_status' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x30c): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_db_statusâ:
sqlite3.c:(.text+0x4a8): multiple definition ofsqlite3_db_status' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x4a8): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_msizeâ:
sqlite3.c:(.text+0x5fdc): multiple definition ofsqlite3_msize' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x5fdc): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_result_errorâ:
sqlite3.c:(.text+0x47d2c): multiple definition ofsqlite3_result_error' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x47d2c): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_stricmpâ:
sqlite3.c:(.text+0xbf3c): multiple definition ofsqlite3_stricmp' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0xbf3c): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_strnicmpâ:
sqlite3.c:(.text+0xc080): multiple definition ofsqlite3_strnicmp' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0xc080): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_value_typeâ:
sqlite3.c:(.text+0x479a4): multiple definition ofsqlite3_value_type' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x479a4): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_value_doubleâ:
sqlite3.c:(.text+0x47784): multiple definition ofsqlite3_value_double' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x47784): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_value_textâ:
sqlite3.c:(.text+0x478f4): multiple definition ofsqlite3_value_text' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x478f4): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_value_bytesâ:
sqlite3.c:(.text+0x4772c): multiple definition ofsqlite3_value_bytes' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x4772c): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_result_doubleâ:
sqlite3.c:(.text+0x47cf8): multiple definition ofsqlite3_result_double' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x47cf8): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_snprintfâ:
sqlite3.c:(.text+0xa114): multiple definition ofsqlite3_snprintf' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0xa114): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_result_textâ:
sqlite3.c:(.text+0x47f20): multiple definition ofsqlite3_result_text' third-party/lib/libsqlite3.so:sqlite3.c:(.text+0x47f20): first defined here /home/ubuntu/Desktop/myWorkspace/testsql/third-party/lib/libsqlite3.so: In function
sqlite3_context_db_handleâ:
sqlite3.c:(.text+0x48934): multiple definition of `sqlite3_context_db_handleâ
.
.
.
.