SQLite

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Post Reply
salvationofpain
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Jun 08, 2009 9:42 pm

SQLite

Post by salvationofpain » Tue Jan 19, 2010 2:38 pm

Hi, i am trying to use SQLite with a simple wxWidgets project in Code::Blocks. (I can use it in a console app).

I copy sqlite3.c to my project folder and add it to the project. Then, i add the path of the folder which includes sqlite3.h to the project's compiler search directories.

While compiling, it opens wrapcctl.h and jump to line 48,

Code: Select all

48   ::SendMessage(hwnd, CCM_SETUNICODEFORMAT, wxUSE_UNICODE, 0);
A few lines of build messages can be seen below. Could anyone please help me figure out what the problem is?

* I am currently checking out wxSqlite3, but i want to solve this.

||=== sqlite2, Release ===|
||warning: ./wx_pch.h.gch/Release_wx_pch_h_gch: not for GNU C|
C:\wxMSW-2.8.10\include\wx\msw\wrapcctl.h||In function `wxSetCCUnicodeFormat':|
C:\wxMSW-2.8.10\include\wx\msw\wrapcctl.h|48|error: syntax error before ':' token|
C:\wxMSW-2.8.10\include\wx\msw\wrapcctl.h|58|error: syntax error before "wxFont"|
C:\wxMSW-2.8.10\include\wx\msw\wrapcctl.h|58|warning: type defaults to `int' in declaration of `wxFont'|
C:\wxMSW-2.8.10\include\wx\msw\wrapcctl.h|58|warning: data definition has no type or storage class|

Mojo
Super wx Problem Solver
Super wx Problem Solver
Posts: 401
Joined: Wed Sep 21, 2005 8:17 am
Location: Rostov-on-Don, Southern Russia

Post by Mojo » Tue Jan 19, 2010 9:17 pm

I'd like to recommend to use wrapper wxSQLite3 http://wxcode.sourceforge.net/components/wxsqlite3/
it's difficult to link SQLite and wxWidgets without intermediate wrapper...
I use wxSQLite3 successfully.
Win XP HE SP3, Vista
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Post by stahta01 » Mon Apr 12, 2010 9:12 pm

Code::Blocks decides whether a file is a "C" or "C++" file based on file extension; please use .cpp for C++ files.

The errors are because the file is being compiled by the C compiler and not the C++ Compiler.

Tim S.

Post Reply