can't install wxsqlite please help! Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

can't install wxsqlite please help!

Post by asitis »

I download wxsqlite3-1.9.5.tar.gz and try compile and install it on ubuntu jaunty. The configure command runs smoothly but make command gives me

@ubuntu9:/home/user/Desktop/wxsqlite# make
/home/user/Desktop/wxsqlite/bk-deps g++ -c -o wxsqlite3_dll_wxsqlite3.o -I./include -DWXMAKINGDLL_WXSQLITE3 -DwxUSE_DYNAMIC_SQLITE3_LOAD=0 -DWXSQLITE3_HAVE_METADATA=0 -DWXSQLITE3_HAVE_CODEC=0 -DWXSQLITE3_HAVE_LOAD_EXTENSION=0 -I/usr/local/include -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O2 ./src/wxsqlite3.cpp
./src/wxsqlite3.cpp:40:21: error: sqlite3.h: No such file or directory

and a whole bunch of error as follow:

./src/wxsqlite3.cpp: In member function ‘wxString wxSQLite3ResultSet::GetDeclaredColumnType(int)’:
./src/wxsqlite3.cpp:719: error: ‘sqlite3_stmt’ was not declared in this scope
./src/wxsqlite3.cpp:719: error: expected primary-expression before ‘)’ token
./src/wxsqlite3.cpp:719: error: ‘sqlite3_column_decltype’ was not declared in this scope
./src/wxsqlite3.cpp: In member function ‘int wxSQLite3ResultSet::GetColumnType(int)’:
./src/wxsqlite3.cpp:732: error: ‘sqlite3_stmt’ was not declared in this scope
./src/wxsqlite3.cpp:732: error: expected primary-expression before ‘)’ token
./src/wxsqlite3.cpp:732: error: ‘sqlite3_column_type’ was not declared in this scope
./src/wxsqlite3.cpp: In member function ‘bool wxSQLite3ResultSet::NextRow()’:
./src/wxsqlite3.cpp:749: error: ‘SQLITE_DONE’ was not declared in this scope
./src/wxsqlite3.cpp:749: error: ‘SQLITE_ROW’ was not declared in this scope
./src/wxsqlite3.cpp:753: error: ‘sqlite3_stmt’ was not declared in this scope
./src/wxsqlite3.cpp:753: error: expected primary-expression before ‘)’ token
./src/wxsqlite3.cpp:753: error: ‘sqlite3_step’ was not declared in this scope
./src/wxsqlite3.cpp:756: error: ‘SQLITE_DONE’ was not declared in this scope
./src/wxsqlite3.cpp:761: error: ‘SQLITE_ROW’ was not declared in this scope
./src/wxsqlite3.cpp:767: error: ‘sqlite3_stmt’ was not declared in this scope
./src/wxsqlite3.cpp:767: error: expected primary-expression before ‘)’ token
./src/wxsqlite3.cpp:767: error: ‘sqlite3_finalize’ was not declared in this scope


I have gone through the readme file that came with wxsqlite but still could not figure it out how to install it. Could someone please help. Thanks in advance

My system
Linux Jaunty
Code::blocks build: Apr 19-2009
wx2.8.9
and a dur-brain
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: can't install wxsqlite please help!

Post by utelle »

asitis wrote:I download wxsqlite3-1.9.5.tar.gz and try compile and install it on ubuntu jaunty. The configure command runs smoothly but make command gives me

@ubuntu9:/home/user/Desktop/wxsqlite# make
/home/user/Desktop/wxsqlite/bk-deps g++ -c -o wxsqlite3_dll_wxsqlite3.o -I./include -DWXMAKINGDLL_WXSQLITE3 -DwxUSE_DYNAMIC_SQLITE3_LOAD=0 -DWXSQLITE3_HAVE_METADATA=0 -DWXSQLITE3_HAVE_CODEC=0 -DWXSQLITE3_HAVE_LOAD_EXTENSION=0 -I/usr/local/include -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O2 ./src/wxsqlite3.cpp
./src/wxsqlite3.cpp:40:21: error: sqlite3.h: No such file or directory

and a whole bunch of error as follow:

[...]

I have gone through the readme file that came with wxsqlite but still could not figure it out how to install it. Could someone please help. Thanks in advance
As the error message states the required header file sqlite3.h could not be found. All consequent errors are provoked by this problem. This means that SQLite is not installed on your system or it is installed at a different location than that assumed by the configure script, i.e. /usr/local.

If SQLite is installed at a different location you have to specify this on invoking configure using the option

--with-sqlite3_prefix=path_where_sqlite_is_installed

BTW invoking "configure --help" shows you all available options with a short explanation.

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

Hi Ulrich, thanks for replying. I have tried your method but still having the same error. I have sqlite3 version 3.6.10 installed through Synaptic Package Manager in Ubuntu and the files are installed in locations
/.
/usr
/usr/bin
/usr/bin/sqlite3
/usr/share
/usr/share/doc
/usr/share/doc/sqlite3
/usr/share/doc/sqlite3/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/sqlite3.1.gz
/usr/share/doc/sqlite3/README
/usr/share/doc/sqlite3/changelog.Debian.gz

I tried to run the configure with prefix with all of the given directories accept those for doc but failed. I am still missing something?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:I have tried your method but still having the same error. I have sqlite3 version 3.6.10 installed through Synaptic Package Manager in Ubuntu and the files are installed in locations
/.
/usr
/usr/bin
/usr/bin/sqlite3
/usr/share
/usr/share/doc
/usr/share/doc/sqlite3
/usr/share/doc/sqlite3/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/sqlite3.1.gz
/usr/share/doc/sqlite3/README
/usr/share/doc/sqlite3/changelog.Debian.gz

I tried to run the configure with prefix with all of the given directories accept those for doc but failed. I am still missing something?
Well, first thing you should do is to verify that you have the header file sqlite3.h somewhere on your system. In your case it should be located in /usr/include.

Makefile.in (used by configure) in the wxSQLite3 distribution assumes that the header file sqlite3.h is located in <prefix>/include and that the link library libsqlite3.a (or libsqlite3.so) is located in <prefix>/lib where <prefix> is the value you specify for --with-sqlite3-prefix.

Make sure that the mentioned files can be found at the specified locations. Alternatively you could change Makefile.in to directly point to the right directories (although this would be a dirty hack and is not recommended).

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

The sqlite3 package that I installed through the Ubuntu Synaptic Package Manager did not contain the header file sqlite3.h . So I removed the installed sqlite3, downloaded sqlite-amalgamation-3.6.17.tar.gz from sqlite web site compiled and installed it and then installed wxsqlite. Things went smoothly. Sorry for being a nuisance but when I tested it with

#include <iostream>
#include "wx/wxsqlite3.h"
using namespace std;

int main()
{
cout << "Hello world!" << endl;
return 0;
}

it gave me
Compiling: /home/user/Desktop/test.cpp
In file included from /home/user/Desktop/test.cpp:3:
/usr/local/include/wx/wxsqlite3.h:20:25: error: wx/datetime.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:21:23: error: wx/buffer.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:22:22: error: wx/regex.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:23:23: error: wx/string.h: No such file or directory

I installed sqlite3 and wxsqlite3 with the default directories. I think they need to be installed in directories in which they can communicate with each other. If so can you tell me how to remove wxsqlite and best directory for reinstalling them please.
qgranfor
Experienced Solver
Experienced Solver
Posts: 89
Joined: Sun Aug 29, 2004 7:32 pm
Location: ND...USA
Contact:

Post by qgranfor »

asitis wrote:The sqlite3 package that I installed through the Ubuntu Synaptic Package Manager did not contain the header file sqlite3.h .
Just an FYI. Typically with Unbuntu Synaptic Package Manger you'll only get development files such as headers if you install package_to_install-dev as well.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:The sqlite3 package that I installed through the Ubuntu Synaptic Package Manager did not contain the header file sqlite3.h . So I removed the installed sqlite3, downloaded sqlite-amalgamation-3.6.17.tar.gz from sqlite web site compiled and installed it and then installed wxsqlite. Things went smoothly.
Good news.
asitis wrote:Sorry for being a nuisance but when I tested it with

#include <iostream>
#include "wx/wxsqlite3.h"
using namespace std;

int main()
{
cout << "Hello world!" << endl;
return 0;
}

it gave me
Compiling: /home/user/Desktop/test.cpp
In file included from /home/user/Desktop/test.cpp:3:
/usr/local/include/wx/wxsqlite3.h:20:25: error: wx/datetime.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:21:23: error: wx/buffer.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:22:22: error: wx/regex.h: No such file or directory
/usr/local/include/wx/wxsqlite3.h:23:23: error: wx/string.h: No such file or directory

I installed sqlite3 and wxsqlite3 with the default directories. I think they need to be installed in directories in which they can communicate with each other. If so can you tell me how to remove wxsqlite and best directory for reinstalling them please.
The error messages have nothing to do with your SQLite installation. Now the compiler can't find the wxWidgets header files. As with every wxWidgets application you have to specify the wxWidgets include directories and the required wxWidgets libraries pn invocation of gcc.

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

qgranfor wrote:
asitis wrote:The sqlite3 package that I installed through the Ubuntu Synaptic Package Manager did not contain the header file sqlite3.h .
Just an FYI. Typically with Unbuntu Synaptic Package Manger you'll only get development files such as headers if you install package_to_install-dev as well.
Good tip thanks. It'll be alot easier to uninstall it in the future.

Ulrich, in wxWidgets app it lets me include "wx/wxsqlite3.h" but when I initialise an object of wxSQLite3Database for example wxSQLite3Database *db = new wxSQLite3Database(); the compiling is ok but when it comes to the linking, it gives me an error message as such undefined reference to 'wxSQLite3Database::wxSQLite3Database()' I know I am almost there pleassssssseeeee
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:Ulrich, in wxWidgets app it lets me include "wx/wxsqlite3.h" but when I initialise an object of wxSQLite3Database for example wxSQLite3Database *db = new wxSQLite3Database(); the compiling is ok but when it comes to the linking, it gives me an error message as such undefined reference to 'wxSQLite3Database::wxSQLite3Database()' I know I am almost there pleassssssseeeee
This indicates the linker does not find the wxSQLite3 library. You have to add a -l option giving the name of the wxSQLite3 library on invoking gcc. The name of the library looks like wxcode_<platform><version><build>_wxsqlite3 where in your case <platform> would be "gtk", <version> probably "28" and <build> something like "ud" (Unicode Debug) depending on your wxWidgets build options.

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

Hi Ulrich
is this the library you mentioned? libwxcode_gtk2u_wxsqlite3-2.8.so

I am using CodeBlocks and I included it by clicking Project->Build Options->Linker Settings then add the location where the above library resides to the list. Now everything seems to be okay except I can execute my program, there is no error message displayed, no warning etc. It just won't execute. I am not adding the -l you mentioned because I'm not sure where it goes. Please be patient I am new to everything
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:is this the library you mentioned? libwxcode_gtk2u_wxsqlite3-2.8.so
Yes.
asitis wrote:I am using CodeBlocks and I included it by clicking Project->Build Options->Linker Settings then add the location where the above library resides to the list. Now everything seems to be okay except I can execute my program, there is no error message displayed, no warning etc. It just won't execute.
That's strange, since if a shared library is missing you should get at least an error message. Before starting your application you must make sure all required shared libraries can be found on the path given by the environment variable LD_LIBRARY_PATH.
asitis wrote:I am not adding the -l you mentioned because I'm not sure where it goes. Please be patient I am new to everything
I don't know much about CodeBlocks, but the linker needs 2 informations: 1) where to look for libraries (option -L<path>) and 2) which libraries to include (option -l<libname> where libname is the name of the library excluding the lib prefix).

If possible post the compiler/linker command line which gets executed when you build your project.

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

utelle wrote:
asitis wrote:is this the library you mentioned? libwxcode_gtk2u_wxsqlite3-2.8.so
Yes.
asitis wrote:I am using CodeBlocks and I included it by clicking Project->Build Options->Linker Settings then add the location where the above library resides to the list. Now everything seems to be okay except I can execute my program, there is no error message displayed, no warning etc. It just won't execute.
That's strange, since if a shared library is missing you should get at least an error message. Before starting your application you must make sure all required shared libraries can be found on the path given by the environment variable LD_LIBRARY_PATH.
asitis wrote:I am not adding the -l you mentioned because I'm not sure where it goes. Please be patient I am new to everything
I don't know much about CodeBlocks, but the linker needs 2 informations: 1) where to look for libraries (option -L<path>) and 2) which libraries to include (option -l<libname> where libname is the name of the library excluding the lib prefix).

If possible post the compiler/linker command line which gets executed when you build your project.

Regards,

Ulrich
Sorry, I've been hit with a flu and had to stay in bed for the last couple of days.

Now back to the business. As per your explanation, I think I've got the linking setup right, but I am still seeking help from the CodeBlocks forum just to make sure.

Here is the build message that CodeBlocks produces, it is not very informative.

For building:

-------------- Build: Release in PC Timer ---------------

Precompiling header: wx_pch.h
Compiling: DBInterface.cpp
Compiling: PC_TimerApp.cpp
Compiling: PC_TimerMain.cpp
/home/user/Desktop/PC Timer/PC_TimerMain.cpp: In member function ‘void PC_TimerFrame::doAction(long int, long int, long int, long int)’:
/home/user/Desktop/PC Timer/PC_TimerMain.cpp:334: warning: unused variable ‘db’
Linking executable: bin/Release/PC Timer
Output size is 94.84 KB
Process terminated with status 0 (0 minutes, 23 seconds)
0 errors, 1 warnings

For executing:

Checking for existence: /home/user/Desktop/PC Timer/bin/Release/PC Timer
Executing: /home/user/Desktop/PC\ Timer/bin/Release/PC\ Timer (in /home/user/Desktop/PC Timer/.)
Process terminated with status 127 (0 minutes, 0 seconds)
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:Now back to the business. As per your explanation, I think I've got the linking setup right, but I am still seeking help from the CodeBlocks forum just to make sure.

Here is the build message that CodeBlocks produces, it is not very informative.
[...]
For executing:

Checking for existence: /home/user/Desktop/PC Timer/bin/Release/PC Timer
Executing: /home/user/Desktop/PC\ Timer/bin/Release/PC\ Timer (in /home/user/Desktop/PC Timer/.)
Process terminated with status 127 (0 minutes, 0 seconds)
Well, as you said the CodeBlocks messages are not very informative. Have you tried to execute your application directly from the command line? This might show a proper error message. My guess is that a shared library can't be found on starting the application.

Regards,

Ulrich
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis »

utelle wrote:
asitis wrote:Now back to the business. As per your explanation, I think I've got the linking setup right, but I am still seeking help from the CodeBlocks forum just to make sure.

Here is the build message that CodeBlocks produces, it is not very informative.
[...]
For executing:

Checking for existence: /home/user/Desktop/PC Timer/bin/Release/PC Timer
Executing: /home/user/Desktop/PC\ Timer/bin/Release/PC\ Timer (in /home/user/Desktop/PC Timer/.)
Process terminated with status 127 (0 minutes, 0 seconds)
Well, as you said the CodeBlocks messages are not very informative. Have you tried to execute your application directly from the command line? This might show a proper error message. My guess is that a shared library can't be found on starting the application.

Regards,

Ulrich
Yes, you're right a shared library cannot be found. here is the error message from the command line
./PCTimer: error while loading shared libraries: libwxcode_gtk2u_wxsqlite3-2.8.so.0: cannot open shared object file: No such file or directory

I guess the library hasn't been linked probably in CodeBlocks. I'll take it from here. The problem is obvious I think I can sort it out, if I can't then I'll bug you again :) Thank you for your help.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:Yes, you're right a shared library cannot be found. here is the error message from the command line
./PCTimer: error while loading shared libraries: libwxcode_gtk2u_wxsqlite3-2.8.so.0: cannot open shared object file: No such file or directory

I guess the library hasn't been linked probably in CodeBlocks. I'll take it from here. The problem is obvious I think I can sort it out
At runtime required shared libraries must be found on one of the paths given in environment variable LD_LIBRARY_PATH. Make sure LD_LIBRARY_PATH includes the path where libwxcode_gtk2u_wxsqlite3-2.8.so.0 resides or move/copy the shared library to a location where it can be found.

Regards,

Ulrich
Post Reply