Author Topic: Sqlite installation into Code::Blocks  (Read 44750 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Sqlite installation into Code::Blocks
« Reply #15 on: June 01, 2006, 02:27:40 pm »
Guillaume: Just download the attached project of my previous post (SQLite3.zip), follow the 5 steps there and you'll get the static version of the library built with Code::Blocks :)

DaveK

  • Guest
Re: Sqlite installation into Code::Blocks
« Reply #16 on: August 02, 2006, 08:27:51 pm »
Why on Earth this is giving me grief is beyond me. i'm having the same issue of getting sqlite3 installed on CodeBlocks.

Everything goes well until it starts to link. Here is the result from the Build Log
Code
mingw32-g++.exe -LD:\CodeBlocks\wx263\lib\gcc_dll -LC:\MinGW\lib  -o bin\Release\ROSIn.exe obj\Release\newcharacterwizardmain.o obj\Release\main.o   -s  -lwxmsw26u -lgdi32 D:\CodeBlocks\sqlite3\libsqlite3.a D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a  -mwindows

here is the resulting issues
Code
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0xa5):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::wxCSConv(wchar_t const*)'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0xd3):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::~wxCSConv()'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x10d):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::~wxCSConv()'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x1e5):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::wxCSConv(wchar_t const*)'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x213):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::~wxCSConv()'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x24d):SqliteDatabaseLayer.cpp: undefined reference to `wxCSConv::~wxCSConv()'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x31a):SqliteDatabaseLayer.cpp: undefined reference to `sqlite3_open'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x35a):SqliteDatabaseLayer.cpp: undefined reference to `sqlite3_errcode'
D:\CodeBlocks\wx263\databaselayer\databaselayer\lib\libdatabaselayer_sqlite.a(databaselayer_sqlite_lib_SqliteDatabaseLayer.o)(.text+0x37f):SqliteDatabaseLayer.cpp: undefined reference to `sqlite3_errmsg'
and so on....

I followed the steps above, and I have a static library for sqlite and even for sqlitedatabaselayer. The dll for sqlite3 is located in the same directory as my executable. The .h file and .a files are copied into the MinGW directories. The static libraries are linked and I have even added some directory information to the build options.
Code
Directories/Compiler: D:\CodeBlocks\wx263\include, D:\CodeBlocks\wx263\lib\gcc_dll\mswu, D:\CodeBlocks\wx263\contrib\include,
D:\CodeBlocks\wx263\databaselayer\databaselayer\include,
D:\CodeBlocks\sqlite3\src,
D:\CodeBlocks\wx263\databaselayer\databaselayer\src
Directories/Linker: D:\CodeBlocks\wx263\lib\gcc_dll

Does anyone know what i could be missing? Obviously sqlitedatabaselayer.cpp is calling objects that I thought should be a part of libdatabaselayer_sqlite.a library. Any ideas?

Thanks!

DeanCB

  • Guest
Re: Sqlite installation into Code::Blocks
« Reply #17 on: December 19, 2013, 12:28:39 am »
Even better:

1. Download the file in step 5.
2. Decompress it somewhere.
3. Copy the attached project (decompress it first) to that folder.
4. Open the project file (with Code::Blocks of course).
5. Click on Build and you'll get libsqlite3.a (static library).

If you don't care too much, just move libsqlite3.a to C:\MinGW\lib (if C:\MinGW is where you have MinGW installed) and sqlite3.h to C:\MinGW\include, or just do as the steps 7 and 8 suggest.

[attachment deleted by admin]

Good day, thank you for explaining this. I have the same problem as the OP and encountered this thread through Google.


Alas, your solution is not working for me. Step 3 onwards doesnt make sense. What do you mean copy project to that folder?

I have downloaded the source files and am trying to make a library out of it and I cant make an ".a" file.

« Last Edit: December 19, 2013, 12:30:38 am by DeanCB »

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: Sqlite installation into Code::Blocks
« Reply #18 on: December 21, 2013, 10:25:24 am »
Ah! Zombie thread rising from the dead! Quick, someone kill it with fire!

lol

Seriously though, this thread is from 2005... Anything advice in it is likely useless by now.

But If your using wxWidgets you shouldn't be trying to use SQLite3 directly anyway. There is a wxWidgets addon called wxSQLite3 that is a wrapper for the SQLite3 library and will make things far easier. You can find it here:

http://wxcode.sourceforge.net/components/wxsqlite3/
« Last Edit: December 21, 2013, 10:50:27 am by ouch »