I have created an app using sqlite3 library. The app works as expected and i have had no problems using mkapp and its update file. When i am trying to use mksys instead, to link three apps together, i am getting error saying “undefined reference to …”.
To use sqlite I created a sqlite.so file using gcc and flags like lpthread. One of the undefined references seems to be pthread. Does anyone know why this becomes a problem when using mksys but not mkapp?
I still get the same error after adding .adef to wifi.sdef. Here is how the error is shown:
checking whether the C compiler works... no configure: error: in /home/sindrekvande/LegatoWorkspace/ths_gw_system/_build_neuronEthernetLteGW/wp76xx/component/37b16d9818aa215e8b1d383409c34f3c/lighttpd: configure: error: C compiler cannot create executables See config.log for more details ninja: build stopped: subcommand failed.
By looking in config.log i can see “undefined reference to (for example pthread functions)”. Could this mean that i have added the sqlite3 library wrong? Sqlite3 uses pthread library, so when I created sqlite3.so I used gcc and flags like lptrhread. Using this file worked well using mkapp. Using mksys it seems like it finds a reference to the used sqlite3 functions, but not libraries which is included in the sqlite3 library.
I have the bundles section in .adef just as like you show, but I do not have a requires section in .cdef, could this be a problem? When using mksys i am running this makefile:
`checking whether the C compiler works... no`
`configure: error: in /home/sindrekvande/LegatoWorkspace/ths_gw_system/_build_neuronEthernetLteGW/wp76xx/component/37b16d9818aa215e8b1d383409c34f3c/lighttpd:`
`configure: error: C compiler cannot create executables`
`See config.log for more details`
`ninja: build stopped: subcommand failed.`
your error in “make wp76xx” is related to lighttpd…
Not sqilte stuff
Sorry, I showed only one of the errors. Here is the first error, and why I think it is sqlite aswell.
/home/sindrekvande/LegatoWorkspace/apps/neuron_iotgw/sqlite3/lib/sqlite3.so
checking for doxygen... :
checking for etags... /bin/false
checking whether make sets $(MAKE)... yes
checking for arm-poky-linux-gnueabi-gcc... /home/sindrekvande/LegatoWorkspace/leaf-data/SWI-WP76/wp76-toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/sindrekvande/LegatoWorkspace/ths_gw_system/_build_neuronEthernetLteGW/wp76xx/component/6becee7effb92d59694c69ef7da8fce7':
configure: error: C compiler cannot create executables
See `config.log' for more details
If you mean using the makefile by that, here are the results with your app:
/home/sindrekvande/LegatoWorkspace/testsql/third-party/lib/libsqlite3.so: In function `sqlite3_global_recover':
sqlite3.c:(.text+0xd2748): multiple definition of `sqlite3_global_recover'
/home/sindrekvande/LegatoWorkspace/testsql/third-party/lib/libsqlite3.so:sqlite3.c:(.text+0xd2748): first defined here
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Makefile:37: recipe for target 'target' failed
make: *** [target] Error 1
I also tried to make .so again, but it did not work.
/opt/swi/y22-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -c -Wall -Werror -fpic -lpthread -ldl sqlite3.c -o ../lib/libsqlite3.so
make: /opt/swi/y22-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc: Command not found
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 127
Seems like doesnt exits arm-poky-linux-gnueabi-gcc
I had installed toolchain, but I had different path and had to add include map to get stdio.h, to make .so. Trying to make the app gives following error now.
/bin/sh: 1: arm-poky-linux-gnueabi-gcc: not found
ninja: build stopped: subcommand failed.