Quantcast

build wxpdfdocument static library

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

build wxpdfdocument static library

Frédéric Bron
Hi,

I am trying to build wxpdfdocument statically but it does not work.
Apparently even if I specify ./configure --disable-shared
--enable-static, it continues to build shared libraries:

checking for wxWidgets version >= 2.8.0... yes (version 3.1.0)
checking for wxWidgets static library... yes
checking for wx-config... /softs/lin64-gcc-6.3.0/release/wx/bin/wx-config
checking for wxWidgets version >= 2.8.0... yes (version 3.1.0)
checking for wxWidgets static library... yes
...
make -j 8 >> /softs/lin64-gcc-6.3.0/release/build/wxpdfdoc-65390a4b.log 2>&1
  CXX      src/pdfannotation.lo
  CXX      src/pdfcffdecoder.lo
  CXX      src/pdfcolour.lo
...
 CXX      showfont/showfont.o
 CXXLD    libwxcode_gtk3u_pdfdoc-3.1.la

*** Warning: Linking the shared library libwxcode_gtk3u_pdfdoc-3.1.la
against the
*** static library
/softs/lin64-gcc-6.3.0/release/wx/lib/libwx_gtk3u_core-3.1.a is not
portable!

*** Warning: Linking the shared library libwxcode_gtk3u_pdfdoc-3.1.la
against the
*** static library
/softs/lin64-gcc-6.3.0/release/wx/lib/libwx_baseu_xml-3.1.a is not
portable!

*** Warning: Linking the shared library libwxcode_gtk3u_pdfdoc-3.1.la
against the
*** static library
/softs/lin64-gcc-6.3.0/release/wx/lib/libwx_baseu-3.1.a is not
portable!
  CXXLD    samples/minimal/minimal
/usr/bin/ld: ./.libs/libwxcode_gtk3u_pdfdoc-3.1.a(pdffontmanager.o):
undefined reference to symbol 'FcPatternAddInteger'
/usr/lib64/libfontconfig.so.1: error adding symbols: DSO missing from
command line

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: build wxpdfdocument static library

Vadim Zeitlin-4
On Fri, 24 Mar 2017 09:20:20 +0100 Frédéric Bron wrote:

FB> I am trying to build wxpdfdocument statically but it does not work.
FB> Apparently even if I specify ./configure --disable-shared
FB> --enable-static, it continues to build shared libraries:
FB>
FB> checking for wxWidgets version >= 2.8.0... yes (version 3.1.0)
FB> checking for wxWidgets static library... yes
FB> checking for wx-config... /softs/lin64-gcc-6.3.0/release/wx/bin/wx-config
FB> checking for wxWidgets version >= 2.8.0... yes (version 3.1.0)
FB> checking for wxWidgets static library... yes

 What did it say about the libraries to be built? If I run wxpdfdoc
configure with --disable-shared here, I see:

checking whether to build shared libraries... no
checking whether to build static libraries... yes

in its output. Do you see the same thing? If not, I suspect a simple typo
in configure command line.

FB> make -j 8 >> /softs/lin64-gcc-6.3.0/release/build/wxpdfdoc-65390a4b.log 2>&1
FB>   CXX      src/pdfannotation.lo
FB>   CXX      src/pdfcffdecoder.lo
FB>   CXX      src/pdfcolour.lo
FB> ...
FB>  CXX      showfont/showfont.o
FB>  CXXLD    libwxcode_gtk3u_pdfdoc-3.1.la

 FWIW I do see the same make output and CXXLD is confusing here because it
just means libtool is being used for linking. But libtool can (and will)
create a static library too, if configured with --disable-shared.

FB>   CXXLD    samples/minimal/minimal
FB> /usr/bin/ld: ./.libs/libwxcode_gtk3u_pdfdoc-3.1.a(pdffontmanager.o):
FB> undefined reference to symbol 'FcPatternAddInteger'
FB> /usr/lib64/libfontconfig.so.1: error adding symbols: DSO missing from
FB> command line

 And it does look like it tries to create a static library here, the real
problem is that we don't use "-lfontconfig" which is needed. However I
don't know why does this happen neither, when wx itself is configured with
--disable-shared, `wx-config --libs` should include it, as it includes all
the libraries required by GTK+ then. E.g. here I get (slightly edited and
wrapped for convenience):

% ./wx-config --libs
-L$build_dir/wx-gtk2-static/lib -pthread
$build_dir/wx-gtk2-static/lib/libwx_gtk2u_xrc-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_gtk2u_qa-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_baseu_net-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_gtk2u_html-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_gtk2u_adv-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_gtk2u_core-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_baseu_xml-3.1.a
$build_dir/wx-gtk2-static/lib/libwx_baseu-3.1.a -pthread
-lgmodule-2.0 -lgthread-2.0 -lrt -lXxf86vm -lSM -lgtk-x11-2.0 -lgdk-x11-2.0
-lpangocairo-1.0 -latk-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lfontconfig
-lfreetype -lnotify -lgdk_pixbuf-2.0 -lXtst -lpng -ljpeg -ltiff -lexpat
-lwxregexu-3.1 -lz -ldl -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lm

 Do you have -lfontconfig in your wx-config output?
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: build wxpdfdocument static library

Frédéric Bron
>  What did it say about the libraries to be built? If I run wxpdfdoc
> configure with --disable-shared here, I see:
>
> checking whether to build shared libraries... no
> checking whether to build static libraries... yes
>
> in its output. Do you see the same thing? If not, I suspect a simple typo
> in configure command line.

same thing:
checking whether to build shared libraries... no
checking whether to build static libraries... yes

I also have:
checking if wxWidgets was built in STATIC mode... yes

>  FWIW I do see the same make output and CXXLD is confusing here because it
> just means libtool is being used for linking. But libtool can (and will)
> create a static library too, if configured with --disable-shared.

I can see .o and .lo files for each .cpp in src

>  And it does look like it tries to create a static library here, the real
> problem is that we don't use "-lfontconfig" which is needed. However I
> don't know why does this happen neither, when wx itself is configured with
> --disable-shared, `wx-config --libs` should include it, as it includes all
> the libraries required by GTK+ then.

no -lfontconfig in wx-config --libs

Here are the options I use to build wx, do you see which one is to blame?
--disable-shared
--enable-cxx11
--enable-stl
--enable-intl
--disable-permissive
--disable-compat28
--disable-compat30
--disable-protocols
--disable-ftp
--disable-http
--disable-fileproto
--disable-sockets
--disable-ipv6
--disable-ipc
--disable-protocol
--disable-protocol-http
--disable-protocol-ftp
--disable-protocol-file
--disable-precomp-headers
--disable-url
--disable-mediactrl
--disable-webkit
--disable-webview
--disable-epollloop
--with-cxx=14
--disable-xrc
--with-libpng
--with-libjpeg
--with-libtiff
--with-liblzma

Thanks,

Frédéric

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[2]: build wxpdfdocument static library

Vadim Zeitlin-4
On Sat, 25 Mar 2017 06:37:41 +0100 Frédéric Bron wrote:

FB> >  And it does look like it tries to create a static library here, the real
FB> > problem is that we don't use "-lfontconfig" which is needed. However I
FB> > don't know why does this happen neither, when wx itself is configured with
FB> > --disable-shared, `wx-config --libs` should include it, as it includes all
FB> > the libraries required by GTK+ then.
FB>
FB> no -lfontconfig in wx-config --libs

 And does it appear in `pkg-config --libs gtk+-2.0`?

FB> Here are the options I use to build wx, do you see which one is to blame?

 No, I don't see anything wrong here.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re[2]: build wxpdfdocument static library

Frédéric Bron
> FB> no -lfontconfig in wx-config --libs
>
>  And does it appear in `pkg-config --libs gtk+-2.0`?

I have GTK+3

$ pkg-config --libs gtk+-3.0
-lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject
-lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
Frédéric

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[4]: build wxpdfdocument static library

Vadim Zeitlin-4
On Sat, 25 Mar 2017 16:56:47 +0100 Frédéric Bron wrote:

FB> > FB> no -lfontconfig in wx-config --libs
FB> >
FB> >  And does it appear in `pkg-config --libs gtk+-2.0`?
FB>
FB> I have GTK+3

 Wait, why does it need FontConfig then? It's a GTK+ 2 library AFAIK.
Something seems to be mixed up here...

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re[4]: build wxpdfdocument static library

Frédéric Bron
> FB> >  And does it appear in `pkg-config --libs gtk+-2.0`?
> FB>
> FB> I have GTK+3
>
>  Wait, why does it need FontConfig then? It's a GTK+ 2 library AFAIK.
> Something seems to be mixed up here...

you mean that it is the configure of wxpdfdocument that should make a
difference between gtk2 and gtk3?

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: build wxpdfdocument static library

Ulrich Telle
In reply to this post by Vadim Zeitlin-4
Am 25.03.2017 um 16:58 schrieb Vadim Zeitlin:

> On Sat, 25 Mar 2017 16:56:47 +0100 Frédéric Bron wrote:
>
> FB> > FB> no -lfontconfig in wx-config --libs
> FB> >
> FB> >  And does it appear in `pkg-config --libs gtk+-2.0`?
> FB>
> FB> I have GTK+3
>
>  Wait, why does it need FontConfig then? It's a GTK+ 2 library AFAIK.
> Something seems to be mixed up here...

Well, under Linux wxPdfDocument depends on FontConfig in the
wxPdfFontManager class to load system defined fonts or to load a font
from a wxFont object.

Up to now wxPdfDocument always build without problems under Linux for
me, since wxWidgets implicitly loaded all dependency libraries.

If the situation is different for GTK+3 this will probably require
adjustments in the wxPdfDocument code.

Regards,

Ulrich

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[6]: build wxpdfdocument static library

Vadim Zeitlin-4
In reply to this post by Frédéric Bron
On Sat, 25 Mar 2017 17:24:16 +0100 Frédéric Bron wrote:

FB> > FB> >  And does it appear in `pkg-config --libs gtk+-2.0`?
FB> > FB>
FB> > FB> I have GTK+3
FB> >
FB> >  Wait, why does it need FontConfig then? It's a GTK+ 2 library AFAIK.
FB> > Something seems to be mixed up here...
FB>
FB> you mean that it is the configure of wxpdfdocument that should make a
FB> difference between gtk2 and gtk3?

 OK, sorry, I've completely misunderstood the issue. The problem is not due
to wxWidgets at all but rather to wxPdfDocument itself, it uses FontConfig
library directly in src/pdffontmanager.cpp but doesn't link with it.

 I'll try to fix this in its configure soon...

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: build wxpdfdocument static library

Ulrich Telle
Am 25.03.2017 um 22:14 schrieb Vadim Zeitlin:

> On Sat, 25 Mar 2017 17:24:16 +0100 Frédéric Bron wrote:
>
> FB> > FB> >  And does it appear in `pkg-config --libs gtk+-2.0`?
> FB> > FB>
> FB> > FB> I have GTK+3
> FB> >
> FB> >  Wait, why does it need FontConfig then? It's a GTK+ 2 library AFAIK.
> FB> > Something seems to be mixed up here...
> FB>
> FB> you mean that it is the configure of wxpdfdocument that should make a
> FB> difference between gtk2 and gtk3?
>
>  OK, sorry, I've completely misunderstood the issue. The problem is not due
> to wxWidgets at all but rather to wxPdfDocument itself, it uses FontConfig
> library directly in src/pdffontmanager.cpp but doesn't link with it.
>
>  I'll try to fix this in its configure soon...

Please keep in mind that wxPdfDocument uses FontConfig only under Linux.
That is, under Windows and Mac OS X the wxPdfFontManager uses other
means to access system fonts or fonts defined by wxFont objects.

Regards,

Ulrich

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re[6]: build wxpdfdocument static library

Frédéric Bron
In reply to this post by Vadim Zeitlin-4
> 2017-03-25 22:14 GMT+01:00 Vadim Zeitlin
>  OK, sorry, I've completely misunderstood the issue. The problem is not due
> to wxWidgets at all but rather to wxPdfDocument itself, it uses FontConfig
> library directly in src/pdffontmanager.cpp but doesn't link with it.
>
>  I'll try to fix this in its configure soon...

So I now use the nearly latest git version of wxwidgets (3ae438b) and
the same for wxpdfdocument (bcfcd2f).
I continue to use --enable-static --disable-shared for wxwidgets itself.

This message concerns a native build on linux with GTK3.

I see that have improved the configure script of wxpdfdoc because I
now get lib/libwxcode_gtk3u_pdfdoc-3.1.a
 when I build wxpdfdocument for gtk3 with --enable-static
--disable-shared options.

The following seems good in the output of wxpdfdoc configure:
> checking if wxWidgets was built in STATIC mode... yes
> checking which wxWidgets toolkit was selected... gtk3

But this is wrong:
> checking if wxWidgets was built in DEBUG mode... no

I get that wether wxwidgets was build in debug or release mode. I use
--enable-debug or --disable-debug when I build wxwidgets. I imagine
that it is harmless and related to the following message from the
wxwidgets configure:
> configure: WARNING: CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option

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!

*** 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_baseu_xml-3.1.a is not
portable!

*** 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_baseu-3.1.a is not portable!

What does this mean?

Frédéric

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Loading...