![]() In order to fix the “ undefined reference to ‘sqlite3_initialize’” errors, we need to locate the library that defines those symbols.As we have included the header files (that provide the definitions for sqlite3_xxx() functions), but have not referenced the library defining them, the linker will fail due to missing definitions for the sqlite3 functions: Replace the contents of the main source file with the following basic project demonstrating the use of sqlite3:.This will copy the sqlite libraries from the Raspberry Pi into the toolchain so that you can reference them from the projects built with that toolchain: Once it is created, open VisualGDB Project Properties and click “Synchronize Sysroot” on the CMake project settings page. Ensure the “test connection” checkbox is checked so that VisualGDB can check that all the necessary packages are present: ![]() On the next page select your Raspberry Pi cross-toolchain and pick the SSH connection for your Pi.On the first page select “Create Application -> CMake -> Ninja”:.Start Visual Studio and open the VisualGDB Linux Project Wizard:.If you are using SmarTTY, the Tools->Manage Linux Packages command can help you find the exact package name easier: Connect to your Raspberry Pi via SSH and install the libsqlite3-dev package.In this tutorial we will use Visual Studio and VisualGDB, however the steps described below will work with any other CMake-based environment. We will create a basic Raspberry Pi project using the sqlite3 library and will then show different ways of using target_link_libraries() to reference the necessary libraries. This tutorial shows various ways to use CMake’s target_link_libraries() statement and explains the differences between them.
0 Comments
Leave a Reply. |