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

Post by asitis »

utelle wrote:
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
It partially works. The app I am making is not for Linux and I didn't wanna muck around with LD_LIBRARY_PATH so I moved the libraries to where they can be found, It is now can be executed from CodeBlocks only but that's ok, I can live with it.

Now another problem arises, the app is made from Linux for Windows and eventually it must be compiled in Windows environment. Can wxSQlite3 be installed in Windows? I've been googling without any result. Do you know where can I find an easiest, step by step, fool proof instruction of how to install wxSQLite3 in Windows?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:It partially works. The app I am making is not for Linux and I didn't wanna muck around with LD_LIBRARY_PATH so I moved the libraries to where they can be found, It is now can be executed from CodeBlocks only but that's ok, I can live with it.
You can change LD_LIBRARY_PATH temporarily like that

Code: Select all

LD_LIBRARY_PATH=.:yourpath:$LD_LIBRARY_PATH your_program
Or you could write a small wrapper script

Code: Select all

#!/bin/sh
export LD_LIBRARY_PATH=yourpath:$LD_LIBRARY_PATH
exec your_program $*
asitis wrote:Now another problem arises, the app is made from Linux for Windows and eventually it must be compiled in Windows environment. Can wxSQlite3 be installed in Windows?
Of course wxSQLite3 can be used on Windows platforms. There is nothing to install. You just compile wxSQLite3 and your application as usual and distribute additionally the SQLite DLL with your application. A precompiled SQLite DLL can be found on the SQLite website or in the wxCode SVN.
asitis wrote:I've been googling without any result. Do you know where can I find an easiest, step by step, fool proof instruction of how to install wxSQLite3 in Windows?
wxSQLite3 comes with build files for several compilers. If that doesn't work for you for some reason you may add the wxSQLite3 sources directly to your own project. wxSQLite3 consists of only one .cpp file and a small number of .h files.

Regards,

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

Post by asitis »

I've got everything running beautifully in Linux platform now. Thanks heap for that. But in Windows platform, I ran makefile.gcc, it gave me two libraries wxsqlite3_lib_wxsqlite3.o.d and wxsqlite3_lib_wxsqlite3.o I linked them the same way I did in Linux, when compiling it is ok but when it comes to linking it gives error message says file format no regconized!


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

Linking executable: bin\Release\PC Timer.exe
C:\CodeBlocks\MinGW\bin\ld.exe:C:\wxWidgets2.8\lib\gccmswd\wxsqlite3_lib_wxsqlite3.o.d: file format not recognized; treating as linker script
C:\CodeBlocks\MinGW\bin\ld.exe:C:\wxWidgets2.8\lib\gccmswd\wxsqlite3_lib_wxsqlite3.o.d:1: syntax error
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 0 warnings

Do you have any clue why it is so? Sorry for dragging on and on. I hope I won't have any more silly questions about this topic after this post
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:I've got everything running beautifully in Linux platform now. Thanks heap for that.
At least that is good news. :)
asitis wrote:But in Windows platform, I ran makefile.gcc, it gave me two libraries wxsqlite3_lib_wxsqlite3.o.d and wxsqlite3_lib_wxsqlite3.o
These are not library files. .o is an object file and .d is a dependency file.

If compiling went ok you should get a file with a name like the following:

libwxcode_msw28u_wxsqlite3.a

This is a library archive which can then be used for linking (linker option -lwxcode_msw28u_wxsqlite3).
asitis wrote:Do you have any clue why it is so?
See above. I hope it helps.

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
Event though I've got the library libwxcode_msw28d_wxsqlite3.a (but with the d instead of the u I think It has something to do with Unicode) I still have linking error messages

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

Linking executable: bin\Release\PC Timer.exe
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxSQLite3Exception':
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `wxString::Format(char const*, ...)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `wxString::Format(char const*, ...)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `~wxSQLite3RegExpOperator':
C:\wxsqlite3\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite3\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3219: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3220: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3189: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3190: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3191: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3192: more undefined references to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)' follow
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3122: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3084: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3330: undefined reference to `wxRegEx::Compile(wxString const&, int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3339: undefined reference to `operator+(wxString const&, char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:3344: undefined reference to `wxString::Format(char const*, ...)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2716: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2719: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2283: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2653: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2594: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2583: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2535: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2537: more undefined references to `wxString::wc_str(wxMBConv const&) const' follow
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1554: undefined reference to `wxDateTime::Format(char const*, wxDateTime::TimeZone const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1542: undefined reference to `wxDateTime::Format(char const*, wxDateTime::TimeZone const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1417: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1224: undefined reference to `wxDateTime::ParseDateTime(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1205: undefined reference to `wxDateTime::ParseTime(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:1186: undefined reference to `wxDateTime::ParseDate(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:956: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:678: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:597: undefined reference to `wxDateTime::ParseDateTime(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:570: undefined reference to `wxDateTime::ParseDateTime(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:544: undefined reference to `wxDateTime::ParseTime(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:517: undefined reference to `wxDateTime::ParseDate(char const*)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2448: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite3\build/../src/wxsqlite3.cpp:2412: undefined reference to `wxString::wc_str(wxMBConv const&) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/string.h:1102: undefined reference to `wxString::Cmp(char const*) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/string.h:1102: undefined reference to `wxString::CmpNoCase(char const*) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/regex.h:103: undefined reference to `wxRegEx::Matches(char const*, int, unsigned int) const'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxStringBase':
C:/wxWidgets2.8/include/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxRegEx':
C:/wxWidgets2.8/include/wx/regex.h:77: undefined reference to `wxRegEx::Init()'
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `_Z14UTF8toWxStringPKc':
C:\wxsqlite3\build/../src/wxsqlite3.cpp:142: undefined reference to `wxString::wxString(wchar_t const*, wxMBConv const&, unsigned int)'
Process terminated with status 1 (0 minutes, 5 seconds)
50 errors, 0 warnings

I failed to recognise what the messages are saying. What is your suggestion? Damn I should have named this thread "The never ending story" :x
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:Even though I've got the library libwxcode_msw28d_wxsqlite3.a (but with the d instead of the u I think It has something to do with Unicode)
Correct. u stands for unicode and d stands for debug. You have to use the version of the library corresponding to your wxWidgets build.
asitis wrote:I still have linking error messages

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

Linking executable: bin\Release\PC Timer.exe
C:\wxsqlite3\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxSQLite3Exception':
C:\wxsqlite3\build/../src/wxsqlite3.cpp:186: undefined reference to `wxString::Format(char const*, ...)'
[...]
Process terminated with status 1 (0 minutes, 5 seconds)
50 errors, 0 warnings

I failed to recognise what the messages are saying. What is your suggestion? Damn I should have named this thread "The never ending story" :x
After puzzling out the current mysteries setting up the next application will be easy. :)

The error messages tell you that the linker does not find some of the wxWidgets libraries.

The reason is either that they are really missing from the linker command line or that the order in which they appear is incorrect. In the first case add the missing libraries (i.e. wxbase28*, wxmsw*_core ...). In the second case specify the wxsqlite3 library before the wxWidgets libraries (unfortunately the gcc linker is a bit dumb).

Regards,

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

Post by asitis »

I am still stuck!!! I linked all the libraries available in C:\wxWidgets2.8\lib\gcc_lib but still without any success.

Below is what I did with wxsqlite after compiling:
Moved all the header files in wxsqlite\include\wx to C:\wxWidgets2.8\include\wx

Moved wxsqlite\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a to C:\wxWidgets2.8\lib\gcc_lib

Moved wxsqlite\src\wxsqlite3.cpp to C:\wxWidgets2.8\src

I then browse to the folder contains the libwxcode_msw28d_wxsqlite3.a file in the linker settings

Is there anything else I should do?

what are the files in build\gccmswd for? especially the object file and the dependency file.

The library file libwxcode_msw28d_wxsqlite3.a generated after compiling with the d not u could this be the cause of the problem? How do you generate the library with the u?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

asitis wrote:Below is what I did with wxsqlite after compiling:
Moved all the header files in wxsqlite\include\wx to C:\wxWidgets2.8\include\wx

Moved wxsqlite\lib\gcc_lib\libwxcode_msw28d_wxsqlite3.a to C:\wxWidgets2.8\lib\gcc_lib

Moved wxsqlite\src\wxsqlite3.cpp to C:\wxWidgets2.8\src
This should not be necessary, if you add the wxSQLite3 paths to your project settings.
asitis wrote:I then browse to the folder contains the libwxcode_msw28d_wxsqlite3.a file in the linker settings

Is there anything else I should do?
You have to make sure you're building and linking versions matching your wxWidgets build.
asitis wrote:what are the files in build\gccmswd for? especially the object file and the dependency file.

The wxSQLite3 build system stores intermediate files like object and dependency files in that directory. These files are not needed to build your own application(s).
asitis wrote:The library file libwxcode_msw28d_wxsqlite3.a generated after compiling with the d not u could this be the cause of the problem?
Yes, certainly. If you want to use the release unicode build of wxWidgets, the wxSQLite3 library file would be libwxcode_msw28u_wxsqlite3.a; for the debug unicode build it would be libwxcode_msw28ud_wxsqlite3.a.
asitis wrote:How do you generate the library with the u?
On invoking the makefile.gcc you have to specify for which wxWidgets build you want to build wxSQLite3. Take a look into the makefile to see the available options. The following options are relevant:

Code: Select all

# Use DLL build of wx library? [0,1]
WX_SHARED ?= 0

# Use Unicode build of wxWidgets? [0,1]
WX_UNICODE ?= 0

# Use debug build of wxWidgets (define __WXDEBUG__)? [0,1]
WX_DEBUG ?= 1

# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= 0
You have to specify all options for which you need values differing from the defaults on the make command line. Alternatively you could edit makefile.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 »

Finally I've got the bastard working :D :D :D

After many trials and errors the settings below for makefile.gcc seem to be the matching

# Use Unicode build of wxWidgets? [0,1]
WX_UNICODE ?= 1

# Use debug build of wxWidgets (define __WXDEBUG__)? [0,1]
WX_DEBUG ?= 1

# Use monolithic build of wxWidgets? [0,1]
WX_MONOLITHIC ?= 1

# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= 1

But I've got a dll with almost 30M in size :cry: If I set SHARED value equal to 0 the linker doesn't like it. Is there a walk around for this?

Anyway, It works and it's Friday. Thank you very much for your patient Ulrich and have a lovely weekend

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

Post by utelle »

asitis wrote:Finally I've got the bastard working :D :D :D
Great!
asitis wrote:... But I've got a dll with almost 30M in size :cry: If I set SHARED value equal to 0 the linker doesn't like it. Is there a walk around for this?
Although the size in debug mode is always larger as in release mode 30M is really big. Sounds like the whole monolithic wxWidgets library is included in the DLL. If you don't have wxWidgets itself as a SHARED library (DLL) but as a STATIC library then there are only very very few occasions where it makes sense to build a wxWidgets dependent DLL as SHARED.

Which messages do you get from the linker when using SHARED=0? I'm sure it's possible to sort this out, too.

Regards,

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

Post by asitis »

Ulrich wrote: Which messages do you get from the linker when using SHARED=0? I'm sure it's possible to sort this out, too.
It would be great if it can be sorted out. With SHARE=0 here goes


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

Linking executable: bin\Release\PC Timer.exe
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `~wxSQLite3RegExpOperator':
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3173: undefined reference to `_sqlite3_user_data'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3163: undefined reference to `_sqlite3_user_data'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3155: undefined reference to `_sqlite3_user_data'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3143: undefined reference to `_sqlite3_aggregate_context'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3124: undefined reference to `_sqlite3_result_error'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3114: undefined reference to `_sqlite3_result_value'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3116: undefined reference to `_sqlite3_result_null'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3101: undefined reference to `_sqlite3_result_null'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3107: undefined reference to `_sqlite3_result_zeroblob'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3096: undefined reference to `_sqlite3_result_blob'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3091: undefined reference to `_sqlite3_result_blob'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3086: undefined reference to `_sqlite3_result_text'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3079: undefined reference to `_sqlite3_result_double'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3074: undefined reference to `_sqlite3_result_int64'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3069: undefined reference to `_sqlite3_result_int'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2968: undefined reference to `_sqlite3_value_type'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3059: undefined reference to `_sqlite3_value_bytes'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3060: undefined reference to `_sqlite3_value_blob'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3039: undefined reference to `_sqlite3_value_text'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3330: undefined reference to `wxRegEx::Compile(wxString const&, int)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3020: undefined reference to `_sqlite3_value_double'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3001: undefined reference to `_sqlite3_value_int64'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2982: undefined reference to `_sqlite3_value_int'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2956: undefined reference to `_sqlite3_value_type'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2931: undefined reference to `_sqlite3_randomness'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2915: undefined reference to `_sqlite3_shutdown'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2903: undefined reference to `_sqlite3_initialize'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2870: undefined reference to `_sqlite3_limit'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2855: undefined reference to `_sqlite3_limit'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2692: undefined reference to `_sqlite3_prepare_v2'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2696: undefined reference to `_sqlite3_errmsg'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2669: undefined reference to `_sqlite3_collation_needed'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2672: undefined reference to `_sqlite3_errmsg'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2658: undefined reference to `_sqlite3_create_collation'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2662: undefined reference to `_sqlite3_create_collation'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2642: undefined reference to `_sqlite3_update_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2646: undefined reference to `_sqlite3_update_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2629: undefined reference to `_sqlite3_rollback_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2633: undefined reference to `_sqlite3_rollback_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2616: undefined reference to `_sqlite3_commit_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2620: undefined reference to `_sqlite3_commit_hook'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2607: undefined reference to `_sqlite3_set_authorizer'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2600: undefined reference to `_sqlite3_create_function'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2587: undefined reference to `_sqlite3_create_function'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2577: undefined reference to `_sqlite3_libversion'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2572: undefined reference to `_sqlite3_busy_timeout'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2565: undefined reference to `_sqlite3_interrupt'
Process terminated with status 1 (0 minutes, 7 seconds)
50 errors, 0 warnings


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

Post by utelle »

asitis wrote:It would be great if it can be sorted out. With SHARE=0 here goes

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

Linking executable: bin\Release\PC Timer.exe
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `~wxSQLite3RegExpOperator':
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
wxSQLite3 implements the SQLite operator REGEXP, so you need to add the wxWidgets regular expression library to the list of link libraries:

wxregex[u[d]].lib

as alwayws u=unicode and d=debug depending on the build you perform.
asitis wrote:C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3173: undefined reference to `_sqlite3_user_data'
[...]
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:2565: undefined reference to `_sqlite3_interrupt'
Process terminated with status 1 (0 minutes, 7 seconds)
50 errors, 0 warnings
These are all references to SQLite itself, so the SQLite link library is missing on the linker command line. Add

sqlite3.lib (or sqlite3.a for MinGW)

to the list of link libraries. Alternatively you may choose to build wxSQLite3 in such a way that the SQLite DLL is loaded at runtime (no link library required) using the preprocessor define wxUSE_DYNAMIC_SQLITE3_LOAD=1 (see wxsqlite3opt.h) (or USE_DYNAMIC_SQLITE3_LOAD=1 on invoking makefile.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 »

utelle wrote:These are all references to SQLite itself, so the SQLite link library is missing on the linker command line. Add

sqlite3.lib (or sqlite3.a for MinGW)
Cool, it fixes the sqlite3 problem.
utelle wrote: wxSQLite3 implements the SQLite operator REGEXP, so you need to add the wxWidgets regular expression library to the list of link libraries:

wxregex[u[d]].lib

as alwayws u=unicode and d=debug depending on the build you perform.
Did you mean libwxregxud.a? because I am using minGW. I have tried libwxregx.a with u, d, etc. all give:

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

Linking executable: bin\Release\PC Timer.exe
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `~wxSQLite3RegExpOperator':
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:\wxsqlite\build/../src/wxsqlite3.cpp:3330: undefined reference to `wxRegEx::Compile(wxString const&, int)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/regex.h:103: undefined reference to `wxRegEx::Matches(wchar_t const*, int, unsigned int) const'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxRegEx':
C:/wxWidgets2.8/include/wx/regex.h:77: undefined reference to `wxRegEx::Init()'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/buffer.h:259: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxStringBase':
C:/wxWidgets2.8/include/wx/string.h:352: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/arrstr.h:155: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/datetime.h:1686: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
10 errors, 0 warnings


I haven't tried your last suggestion, will try it at home

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

Post by utelle »

asitis wrote:
utelle wrote:wxregex[u[d]].lib

as alwayws u=unicode and d=debug depending on the build you perform.
Did you mean libwxregxud.a?
Yes.
asitis wrote:because I am using minGW. I have tried libwxregx.a with u, d, etc.
You have to use the library matching your wxWidgets build. If you use Unicode Debug it would be libwxregxud.a; if you use Unicode Release it would be libwxregxu.a.
asitis wrote:all give:

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

Linking executable: bin\Release\PC Timer.exe
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `~wxSQLite3RegExpOperator':
C:\wxsqlite\build/../src/wxsqlite3.cpp:3318: undefined reference to `wxRegEx::~wxRegEx()'
const*, int, unsigned int) const'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxRegEx':
C:/wxWidgets2.8/include/wx/regex.h:77: undefined reference to `wxRegEx::Init()'
These are related to wxregex library ...
asitis wrote:C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/buffer.h:259: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o): In function `wxStringBase':
C:/wxWidgets2.8/include/wx/string.h:352: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/arrstr.h:155: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
C:\wxWidgets2.8\lib\gcc_lib\libwxcode_msw28ud_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):C:/wxWidgets2.8/include/wx/datetime.h:1686: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
... but these are probably related to wxbase.

The order in which libraries are specified to the linker matters. To resolve references the MinGW (resp. gcc) linker searches through the libraries in the order given on the command line. That is if library A needs modules from library B, the order has to be 1. A, 2. B. If you do it vice versa (1. B, 2. A) you'll get unresolved references.

In short, make sure the order of link libraries is correct.
asitis wrote:I haven't tried your last suggestion, will try it at home
Dynamically loading the SQLite DLL eliminates the need for the SQLite link library, but not for the other libraries like wxregex.

Regards,

Ulrich
Post Reply