wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
AshtonC1
Earned some good credits
Earned some good credits
Posts: 100
Joined: Wed Feb 18, 2015 4:56 pm

wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Post by AshtonC1 »

I'm trying to install wxSQLite3 and have an issue not seen before.

Here is the make result:

stv@HpNotebook ~/Downloads/wxsqlite3-3.5.3 $ make
CC sqlite3/secure/src/sqlite3secure.lo
CXX src/wxsqlite3.lo
CXXLD libwxcode_gtk3u_wxsqlite3-3.0.la

*** Warning: Linking the shared library libwxcode_gtk3u_wxsqlite3-3.0.la against the
*** static library /usr/local/lib/libwx_gtk3u_core-3.0.a is not portable!

*** Warning: Linking the shared library libwxcode_gtk3u_wxsqlite3-3.0.la against the
*** static library /usr/local/lib/libwx_baseu-3.0.a is not portable!
ar: `u' modifier ignored since `D' is the default (see `U')
CXX samples/minimal.o
CXXLD samples/minimal
CXX samples/treeview/foldertree.o
CXX samples/treeview/projectlist.o
CXX samples/treeview/treeviewapp.o
CXX samples/treeview/treeviewsample.o
CXXLD samples/treeview/treeview

This was after using: ./configure --disable-shared.

Did Not Create a libwxcode_gtk3u-wxsqlite3-3.0.so.0 file either without --disable-shared flag.

Not sure if I need to reload the OS and start over or what.
I have another fully working linux PC, with no wxSQLite3 problems (using wxSQLite3 shared, no make warnings).
Last edited by AshtonC1 on Sun Jun 11, 2017 8:42 pm, edited 1 time in total.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Post by utelle »

Unfortunately I don't have thorough Linux experiences. However, a similar question about my other component wxPdfDocument was answered by Vadim Zeitlin on the wxWidgets mailing list. I quote his post below:
Vadim Zeitlin wrote:
FB wrote: While building wxpdfdoc, I then see this warning:
*** Warning: Linking the shared library libwxcode_gtk3u_pdfdoc-3.1.la against the
*** static library /softs/lin64-gcc-6.3.0/debug/wx/lib/libwx_gtk3u_core-3.1.a is not portable!
...
What does this mean?
IMO it means a bug in libtool because we're not actually creating any shared libraries here (I've just confirmed this by building it with the same configure arguments and it's definitely built as a static library and you can easily confirm that this is the case by either just checking the libwxcode_gtk3u_pdfdoc-3.1.a file itself or, indirectly, by running ldd on any of the samples/utilities).

We do create the libtool convenience library (.la) because our makefile rules are written to create it as we don't know if we're going to build static or shared libraries beforehand -- and when building the shared ones, it is really needed. Ideally, libtool would account for this case, but currently it doesn't and, to be honest, I'm not annoyed by it enough to bother making a patch fixing this. So I suggest just ignoring those as well.
I guess the warning can be safely ignored as long as you build, link, and use the static library only. That should work. If not, please quote the full output of your invocation of the configure script.

Regards,

Ulrich
AshtonC1
Earned some good credits
Earned some good credits
Posts: 100
Joined: Wed Feb 18, 2015 4:56 pm

Re: wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Post by AshtonC1 »

Thanks Ulrich,

I have tried using the files created, and ignoring the warnings:
It creates .la file type, not .a, that I have never seen, resulting in 'file not recognized: File format not recognized'.

File created: libwxcode_gtk3u_wxsqlite3-3.0.la.

At this point I'd settle for the shared file: libwxcode_gtk3u-wxsqlite3-3.0.so.0
I may try to use a copy of this from the other PC. (didn't allow copy & paste, not giving up)
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Post by DavidHart »

Are you sure it isn't working, and can't be used for static linking? I ask because:

I replicated what I think is your setup, a static wx3.0.3 build and /wxsqlite3 3.5.3, and configured it as you did. After doing:
mkdir build-dir && cd build-dir
and then configuring and building, there is a build-dir/.libs/ dir that contains libwxcode_gtk3u_wxsqlite3-3.0.a.

build-dir/ also contains the samples minimal and treeview. I tested them and they seem to work (I'm not database savvy, so I don't guarantee they really did).
Testing for dynamic linking with ldd ./minimal, none of the symbols seemed to come from wxsqlite, so it does seem to be statically linked.

Googling and the libtool manual suggests that both .la and .a are created and iiuc you can choose which you use. There are supposed to be ways to create only the .a, e.g. passing --static to LDFLAGS, but on quick testing I couldn't get them to work.
AshtonC1
Earned some good credits
Earned some good credits
Posts: 100
Joined: Wed Feb 18, 2015 4:56 pm

Re: wxSQLite3 linux install, libwx_gtk3u, shared & static question.

Post by AshtonC1 »

Thanks David,
there is a build-dir/.libs/ dir that contains libwxcode_gtk3u_wxsqlite3-3.0.a
I succeeded at that last night using ../configure --enable-static .

Thanks for your time testing this.
Post Reply