Hi,
I'm having trouble to compile wxsqlite3. I'm trying to set up a development environment with code blocks, mingw, wxwidgets 2.9.4 and wxsqlite 3 in windows xp; wxwidgets has been compiled and tested and everything seems to be correct; I compiled wxwidgets as a monolithic shared library (dll) and when I try to compile wxsqlite 3 (using build29 makefile.gcc) I receive some warnings and 1 error: "mingw32\bin\ld.exe: cannot find -lwxbase29ud".
This is my makefile.gcc configuration:
# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared
# C++ compiler
CXX = g++
# Standard flags for C++
CXXFLAGS ?=
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=
# Standard linker flags
LDFLAGS ?=
# Use DLL build of wx library? [0,1]
WX_SHARED ?= 1
# Use debug build of wxWidgets (linked with debug CRT)? [0,1]
WX_DEBUG ?= 1
# Version of the wx library to build against.
WX_VERSION ?= 29
# The directory where wxWidgets library is installed
WX_DIR ?= $(WXWIN)
# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= 1
# If 1 then the SQLite library will be loaded dynamically at run time [1,0]
USE_DYNAMIC_SQLITE3_LOAD ?= 0
# If 1 then the SQLite library has to be compiled with meta data support [1,0]
HAVE_METADATA ?= 0
# If 1 then the SQLite library has to be compiled with codec support [1,0]
HAVE_CODEC ?= 0
# If 1 then the SQLite library has to be compiled with loadable extension support [1,0]
HAVE_LOAD_EXTENSION ?= 0
# Folder where the SQLite3 link library is located
SQLITE3_DIR ?= ..\sqlite3
Two files are created anyway: wxsqlite3_dll_wxsqlite3.o and wxsqlite3_dll_wxsqlite3.o.d in gccmswud_dll folder but I don't know how to use these files and if they are correct. I cannot find a complete step by step guide to compile and test wxsqlite3 so I am very confused...
Please help me.
salagadula wrote:Hi,
I'm having trouble to compile wxsqlite3. I'm trying to set up a development environment with code blocks, mingw, wxwidgets 2.9.4 and wxsqlite 3 in windows xp; wxwidgets has been compiled and tested and everything seems to be correct; I compiled wxwidgets as a monolithic shared library (dll) and when I try to compile wxsqlite 3 (using build29 makefile.gcc) I receive some warnings and 1 error: "mingw32\bin\ld.exe: cannot find -lwxbase29ud".
...
Two files are created anyway: wxsqlite3_dll_wxsqlite3.o and wxsqlite3_dll_wxsqlite3.o.d in gccmswud_dll folder but I don't know how to use these files and if they are correct. I cannot find a complete step by step guide to compile and test wxsqlite3 so I am very confused...
The makefile coming with wxSQLite3 for wxWidgets 2.9.x (build29 folder) currently does not support the monolithic builds. Probably you can use the makefile for wxWidgtes 2.8.x (build folder) by just setting WX_VERSION to 29.
Another option is to just add the wxSQLite3 source files to your own project - wxSQLite3 consists of only a single C++ source file and a few header files.
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.9 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared
# C++ compiler
CXX = g++
# Standard flags for C++
CXXFLAGS ?=
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=
# Standard linker flags
LDFLAGS ?=
# Use DLL build of wx library? [0,1]
WX_SHARED ?= 1
# Use Unicode build of wxWidgets? [0,1]
WX_UNICODE ?= 1
# Use debug build of wxWidgets (linked with debug CRT)? [0,1]
WX_DEBUG ?= 1
# Version of the wx library to build against.
WX_VERSION ?= 29
# Use monolithic build of wxWidgets? [0,1]
WX_MONOLITHIC ?= 1
# The directory where wxWidgets library is installed
WX_DIR ?= $(WXWIN)
# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= 1
# If 1 then the SQLite library will be loaded dynamically at run time [1,0]
USE_DYNAMIC_SQLITE3_LOAD ?= 0
# If 1 then the SQLite library has to be compiled with meta data support [1,0]
HAVE_METADATA ?= 0
# If 1 then the SQLite library has to be compiled with codec support [1,0]
HAVE_CODEC ?= 0
# If 1 then the SQLite library has to be compiled with loadable extension support [1,0]
HAVE_LOAD_EXTENSION ?= 0
# Folder where the SQLite3 link library is located
SQLITE3_DIR ?= ..\sqlite3
salagadula wrote:Many thanks for your answer. I created the dll using the other makefile, also minimal.exe has been created but it doesn't run, I receive this message:
The application failed to initialize properly (0xc0000005).
I put all the dll files (wxWidgets, wxsqlite3 and sqlite3) in the samples folder and this is the makefile.gcc file:
...
Where is the error?
I don't have experience with the monolithic build of wxWidgets. Therefore I don't know whether there are additonal dependencies. You have to check whether all required DLLs are accessible.
On which platform are you working? 32 bit or 64 bit? On Windows the code 0xc0000005 means "access violation" (using an invalid memory address). Please try to use the debug version to find out at which code line the application crashes.
I had errors because I compiled wxSqlite using the debug version; compiling without debug everything is ok.
Now I should like to know how to test it in wxWidgets: where could I find some examples? Where are the visual controls in Code Blocks wxWidgets project?
salagadula wrote:I had errors because I compiled wxSqlite using the debug version; compiling without debug everything is ok.
That's fine - although it's unclear what went wrong before.
salagadula wrote:Now I should like to know how to test it in wxWidgets: where could I find some examples? Where are the visual controls in Code Blocks wxWidgets project?
Well, there is nothing in the wxWidgets library to connect visual controls with database tables for displaying and editing database contents. You'll have to develop the code for that yourself ...
The minimal sample coming with wxSQLite3 just demonstrates how to access a SQLite database using wxSQLite3 classes and methods.