wxSQLIte3 from sources...

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
dkaip
Earned some good credits
Earned some good credits
Posts: 136
Joined: Wed Jan 20, 2010 1:15 pm

wxSQLIte3 from sources...

Postby dkaip » Fri Jan 26, 2018 7:29 pm

Hello, very thanks for lib.
I am trying to compile minimal with only source files , so i post a piece of source CodeBlocks file, because compiler says ..
...wxsqlite3-3.5.9/src/wxsqlite3.cpp|1329|undefined reference to `sqlite3_column_database_name'


But there is at "sqlite3.h"

Code: Select all

<Compiler>
<Add option="-Wall" />
<Add option="-std=c++14" />
<Add option="`/home/a/wxWidgets-3.0.3/gtk-build/wx-config --cflags`" />
<Add directory="/home/a/wxsqlite3-3.5.9/include" />
<Add directory="/home/a/wxsqlite3-3.5.9/sqlite-amalgamation-3220000" />
<Add directory="/home/a/wxsqlite3-3.5.9/sqlite3/secure/src" />
</Compiler>
<Linker>
<Add option="`/home/a/wxWidgets-3.0.3/gtk-build/wx-config  --libs all`" />
</Linker>
<Unit filename="include/wx/wxsqlite3.h" />
<Unit filename="include/wx/wxsqlite3_version.h" />
<Unit filename="include/wx/wxsqlite3def.h" />
<Unit filename="include/wx/wxsqlite3dyn.h" />
<Unit filename="include/wx/wxsqlite3opt.h" />
<Unit filename="samples/minimal.cpp" />
<Unit filename="sqlite-amalgamation-3220000/sqlite3.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="sqlite-amalgamation-3220000/sqlite3.h" />
<Unit filename="sqlite-amalgamation-3220000/sqlite3ext.h" />
<Unit filename="src/wxsqlite3.cpp" />


Linux Mint, Gcc, CodeBlocks.

User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 420
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: wxSQLIte3 from sources...

Postby xaviou » Fri Jan 26, 2018 10:22 pm

Hi.

When you get a "undefined reference to ...." error, it generaly comes from the linker.
And it generaly means you forgot a lib (or, in case you use gcc, your libs are not in the correct order)

In your case, it seems you didn't add the wxsqlite lib to your linker options.

Do it, and it should solve your problem.

Regards
Xav'
My wxWidgets stuff web page : X@v's wxStuff

utelle
Moderator
Moderator
Posts: 789
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLIte3 from sources...

Postby utelle » Sat Jan 27, 2018 12:45 pm

dkaip wrote:Hello, very thanks for lib.
I am trying to compile minimal with only source files , so i post a piece of source CodeBlocks file, because compiler says ..
...wxsqlite3-3.5.9/src/wxsqlite3.cpp|1329|undefined reference to `sqlite3_column_database_name'


But there is at "sqlite3.h"

Code: Select all

<Compiler>
<Add option="-Wall" />
<Add option="-std=c++14" />
<Add option="`/home/a/wxWidgets-3.0.3/gtk-build/wx-config --cflags`" />
<Add directory="/home/a/wxsqlite3-3.5.9/include" />
<Add directory="/home/a/wxsqlite3-3.5.9/sqlite-amalgamation-3220000" />
<Add directory="/home/a/wxsqlite3-3.5.9/sqlite3/secure/src" />
</Compiler>
<Linker>
<Add option="`/home/a/wxWidgets-3.0.3/gtk-build/wx-config  --libs all`" />
</Linker>
<Unit filename="include/wx/wxsqlite3.h" />
<Unit filename="include/wx/wxsqlite3_version.h" />
<Unit filename="include/wx/wxsqlite3def.h" />
<Unit filename="include/wx/wxsqlite3dyn.h" />
<Unit filename="include/wx/wxsqlite3opt.h" />
<Unit filename="samples/minimal.cpp" />
<Unit filename="sqlite-amalgamation-3220000/sqlite3.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="sqlite-amalgamation-3220000/sqlite3.h" />
<Unit filename="sqlite-amalgamation-3220000/sqlite3ext.h" />
<Unit filename="src/wxsqlite3.cpp" />


Linux Mint, Gcc, CodeBlocks.

The wxSQLite3 distribution is self-contained. That is, you don't need to download the SQLite sources separately; they are included in subfolder sqlite3/secure/src of the wxSQLite3 distribution. No need for sqlite-amalgamation-3220000. (And usually wxSQLite3 is updated shortly after a release of a new SQLite3 version.)

There are several compile time options required to compile SQLite3 and wxSQLite3, some of them have to match, so that you don't get conflicts. For example, the option WXSQLITE3_HAVE_METADATA is enabled by default (see include/wx/wxsqlite3opt.h). However, this option requires that SQLite3 is compiled with the option SQLITE_ENABLE_COLUMN_METADATA. In your Code::Blocks project file I see no trace of any compile time options ... and this means you are seeking for trouble ... as you experienced.

Regards,

Ulrich

dkaip
Earned some good credits
Earned some good credits
Posts: 136
Joined: Wed Jan 20, 2010 1:15 pm

Re: wxSQLIte3 from sources...

Postby dkaip » Sun Feb 04, 2018 6:09 pm

Thank you very match for instructions. I am just find some time to see it.
I hope to find a litle time to try.
Thank's
Jim.


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 2 guests