Another wxSQLite3 Installation Question

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Another wxSQLite3 Installation Question

Post by Slyde »

For every reason you can think of, I'm not a Windows user. BUT...I have to use it for a time for work-related stuff. I installed Code::Blocks. Finally got wxWidgets to compile (using the C::B mingw compiler and not version 8.2.0). And lastly, I need to install wxSQLite3. The only info on this I found that showed promise was this. But file names are wrong. Found a youtube vid that looked like a 3rd grader had put together. And I'm as lost now as I was before I started.
Not everyone is on the same level. I'm one of those who damn near needs pics to understand some things. That's an exaggeration, but it'd be a lot of help to have clear, concise, step-by-step directions on how to install this for use in Code::Blocks. And maybe they're out there already, but I haven't seen them. Anyone?
Linux Mint 21.3 | wxWidgets-3.2.4
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Another wxSQLite3 Installation Question

Post by doublemax »

Have you tried building the library through the makefile?
https://github.com/utelle/wxsqlite3#install

Alternatively, you can just add all source files to your project:
viewtopic.php?p=166524#p166524

You can get the SQLite Amalgamation from here:
https://www.sqlite.org/download.html
Use the source, Luke!
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Re: Another wxSQLite3 Installation Question

Post by Slyde »

Hi doublemax.

I copied the sqlite3.dll and wxsqlite3.cpp into my project folder. Are there any linker options in Code::Blocks I need to be concerned abt?

Isn't wxSQLite3 supposed to be compiled before using it?
Linux Mint 21.3 | wxWidgets-3.2.4
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Another wxSQLite3 Installation Question

Post by doublemax »

If you add all *source* files to your project like in the 2nd link i posted, you don't need and additional linker settings.
Use the source, Luke!
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Re: Another wxSQLite3 Installation Question

Post by Slyde »

I put all the files inside my project folder. Tried to #include "wxsqlite3.h" and got a fatal error.

So I created another folder "wx" and put the wxSQLite3 files in it, the #include "wx/wxsqlite3.h" and got another fatal error.

Code: Select all

C:\Users\lands\OneDrive\Desktop\CodeBlocks\Sidewinder\SidewinderMain.h:24:26: fatal error: wx/wxsqlite3.h: No such file or directory
It shldn't be a difficult thing, man. I don't like to give up on anything, but this is to the point of being ridiculous. What am I not doing right?
Last edited by Slyde on Mon Jul 15, 2019 12:54 am, edited 1 time in total.
Linux Mint 21.3 | wxWidgets-3.2.4
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Another wxSQLite3 Installation Question

Post by utelle »

Slyde wrote: Sun Jul 14, 2019 12:51 am For every reason you can think of, I'm not a Windows user. BUT...I have to use it for a time for work-related stuff.
For me it is the other way around: most of the time I develop under Windows and seldom under other platforms like Linux.
Slyde wrote: Sun Jul 14, 2019 12:51 am I installed Code::Blocks.
I have to admit that I don't know much about Code::Blocks, because most of the time I use Visual Studio C++.
Slyde wrote: Sun Jul 14, 2019 12:51 am Finally got wxWidgets to compile (using the C::B mingw compiler and not version 8.2.0).
Which compiler version are you actually using?

And why don't you use a precompiled wxWidgets library? wxWidgets releases come with several precompiled versions. Using one of them can make life a lot easier, especially for an occasional Windows user.
Slyde wrote: Sun Jul 14, 2019 12:51 am And lastly, I need to install wxSQLite3. The only info on this I found that showed promise was this. But file names are wrong. Found a youtube vid that looked like a 3rd grader had put together.
Both sources are really outdated. Since almost 4 years wxSQLite3 is hosted on GitHub: wxSQLite3 on GitHub. The readme file contains basic instructions for installing/compiling and using wxSQLite3. And if questions remain they can be asked on GitHub or here in the wxWidgets forum.
Slyde wrote: Sun Jul 14, 2019 12:51 am ... but it'd be a lot of help to have clear, concise, step-by-step directions on how to install this for use in Code::Blocks.
AFAICT instructions specifically for use in Code::Blocks do not exist. However, wxSQLite3 could be compiled outside of Code::Blocks by using the makefile coming with wxSQLite3. Thereafter, all what would be required for using wxSQLite3 in your own Code::Blocks projects would be to reference the wxSQLite3 library (adding the path to the header files for the C++ preprocessor, and adding the library to the list of required link libraries for the linker).

Recently, a user of wxSQLite3 added CMake support. CMake then allows to generate a Code::Blocke project file for building wxSQLite3. However, personally I don't use CMake, so that I can't answer CMake specific questions.

Regards,

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

Re: Another wxSQLite3 Installation Question

Post by utelle »

Slyde wrote: Sun Jul 14, 2019 8:02 am I copied the sqlite3.dll and wxsqlite3.cpp into my project folder.
Since wxSQLite3 version 3.5.0 (released in January 2017) the SQLite3 library is an integrated part of wxSQLite3. This really helps to avoid version mismatches. Although it is still possible to use wxSQLite3 together with a SQLite3 DLL, this is not recommended. And most likely I will drop support for using a SQLite3 DLL with one of the next wxSQLite3 releases.
Slyde wrote: Sun Jul 14, 2019 8:02 am Are there any linker options in Code::Blocks I need to be concerned abt?
AFAIK there are no Code::Blocks specific linker options. Usually one just has to add the link library name and path for the linker.
Slyde wrote: Sun Jul 14, 2019 8:02 am Isn't wxSQLite3 supposed to be compiled before using it?
Personally, I prefer to build wxSQLite3 as a separate library (either static or shared/DLL) and I'd recommend to follow that route. But I know that many users prefer to add the wxSQLite3 sources to their own project. However, the latter is a bit more complex since SQLite3 itself is bundled with wxSQLite3. To make that work properly you need to add all SQLite3 source files (located in sqlite3secure/src) and to specify a bunch of preprocessor symbols. (If you don't need database encryption support, it is slightly easier, of course.)

Regards,

Ulrich
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Another wxSQLite3 Installation Question

Post by doublemax »

In addition to what Ulrich (the author of wxSQLite3) said, forget what i wrote about just adding all the source files. I just tried it and this method doesn't work any more, at least not as easily. So you have to try to build wxSQLite3 "the hard way".
Use the source, Luke!
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Another wxSQLite3 Installation Question

Post by utelle »

doublemax wrote: Sun Jul 14, 2019 7:42 am Have you tried building the library through the makefile?
https://github.com/utelle/wxsqlite3#install
This should definitely work, since typically Code::Blocks is used together with a Mingw compiler version.
doublemax wrote: Sun Jul 14, 2019 7:42 am Alternatively, you can just add all source files to your project:
viewtopic.php?p=166524#p166524
Nowadays it is a bit more involved. At least, if you want to have database encryption support.
doublemax wrote: Sun Jul 14, 2019 7:42 am You can get the SQLite Amalgamation from here:
https://www.sqlite.org/download.html
Downloading the SQLite3 sources separately is no longer required. The SQLite3 amalgamation sources are bundled with wxSQLite3 since January 2017.

Regards,

Ulrich
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Re: Another wxSQLite3 Installation Question

Post by Slyde »

Personally, I prefer to build wxSQLite3 as a separate library (either static or shared/DLL) and I'd recommend to follow that route.
That's my problem, utelle: I don't know how to do this.
Which compiler version are you actually using?
MinGW 5.1.0
Both sources are really outdated. Since almost 4 years wxSQLite3 is hosted on GitHub: wxSQLite3 on GitHub. The readme file contains basic instructions for installing/compiling and using wxSQLite3. And if questions remain they can be asked on GitHub or here in the wxWidgets forum.
I don't understand the basic instruction.

All I need to be able to do is build wxSQLite3. I have it, and I just need to know how to build it. ALL I've seen so far doesn't do it for me. I've read your installation instructions on github, googled and googled...nothing makes a lick of sense to me.
Linux Mint 21.3 | wxWidgets-3.2.4
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Another wxSQLite3 Installation Question

Post by utelle »

doublemax wrote: Sun Jul 14, 2019 9:34 am In addition to what Ulrich (the author of wxSQLite3) said, forget what i wrote about just adding all the source files. I just tried it and this method doesn't work any more, at least not as easily. So you have to try to build wxSQLite3 "the hard way".
I really wouldn't call it "the hard way". Using the makefile coming with wxSQLite3 should work almost right out of the box. Minor adjustments to the configuartion file config.gcc should be sufficient (i.e., one has to verify that the symbols wxRootDir and wxCompilerPrefix are properly set.

Regards,

Ulrich
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Another wxSQLite3 Installation Question

Post by doublemax »

Downloading the SQLite3 sources separately is no longer required. The SQLite3 amalgamation sources are bundled with wxSQLite3 since January 2017.
Yeah, sorry for the misinformation. I usually don't update wxSQLite3 as my version is heavily modified to get rid of the exceptions, which is a tedious amount of manual editing :)
Use the source, Luke!
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Re: Another wxSQLite3 Installation Question

Post by Slyde »

It's cool, doublemax. You tried. I just need to know how to Build wxSQLite3 so I can use it. I'll get the right information, eventually.
Linux Mint 21.3 | wxWidgets-3.2.4
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Another wxSQLite3 Installation Question

Post by utelle »

Slyde wrote: Sun Jul 14, 2019 9:42 am
Personally, I prefer to build wxSQLite3 as a separate library (either static or shared/DLL) and I'd recommend to follow that route.
That's my problem, utelle: I don't know how to do this.
Since you use a Mingw compiler you can use the makefile coming with wxSQLite3 to build wxSQLite3. This will require to adjust the configuration file config.gcc (see my other post). And you need to select a configuration - that is, you need to decide whether you want to build a release or debug version, a version for 32-bit or 64-bit, a static or shared library, and whether wxWidgets is used as a static or shared library.

For examples, building configuration release_wxdll_x32 would result in a static wxSQLite3 library (32-bit release version, wxWidgets as DLL).
Slyde wrote: Sun Jul 14, 2019 9:42 am
Which compiler version are you actually using?
MinGW 5.1.0
This compiler is rather outdated. I would strongly recommend to use a more recent version.
Slyde wrote: Sun Jul 14, 2019 9:42 am
Both sources are really outdated. Since almost 4 years wxSQLite3 is hosted on GitHub: wxSQLite3 on GitHub. The readme file contains basic instructions for installing/compiling and using wxSQLite3. And if questions remain they can be asked on GitHub or here in the wxWidgets forum.
I don't understand the basic instruction.
If you don't know how to build a program using gcc (Mingw is a gcc variant for Windows), you will need to learn it. Invoking the make utility of the compiler from the command line is a very basic step. It looks like this:

Code: Select all

make config=release_wxdll_x32
Regards,

Ulrich
Slyde
Earned some good credits
Earned some good credits
Posts: 130
Joined: Mon Apr 09, 2018 11:08 pm

Re: Another wxSQLite3 Installation Question

Post by Slyde »

This compiler is rather outdated. I would strongly recommend to use a more recent version.
I actually have MinGW 8.2.0. But I had to resort to the MinGW 5.1.0 compiler that came with Code::Blocks to compile wxWidgets. So switching back now to the 8.2.0 compiler isn't going to break anything?
Linux Mint 21.3 | wxWidgets-3.2.4
Post Reply