You are not logged in.

#1 2015-08-24 16:14:17

ZoLA
Member
Registered: 2014-04-07
Posts: 22

[SOLVED] wxWidgets

HI guys, i have installed wxwidgets using pacman 'sudo pacman -S wxgtk' and if i put simple program with wxPuts() just to print text using wx function i got to much errors in compile time. I try to compile with this:  g++ main.cpp `wx-config --cxxflags --libs` -o main
wx-config --version : 3.0.2

Last edited by ZoLA (2015-08-25 17:38:41)

Offline

#2 2015-08-24 16:56:58

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

Please, post the code you are trying to compile and the full compilation output with the error messages.


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-08-24 17:45:12

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

Offline

#4 2015-08-24 18:52:38

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

It compiled fine on my desktop, but it failed on my laptop with a similar error: wx-config tells the compiler to link the following libraries:

$ wx-config --libs
-pthread   -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_webview-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

now the problem is that libwx_gtk2u_webview-3.0.so is linked to libwebkitgtk-1.0.so.0 which is provided by the package webkitgtk2. So, you have two options:

  • Use wx-config and Install the package webkitgtk2

  • Don't use wx-config and manually specify the libraries to link to, for example

     g++ main.cpp -o main -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -DWXUSINGDLL -D__WXGTK__ -pthread -lwx_gtk2u_core-3.0  -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

--edit: typo

Last edited by mauritiusdadd (2015-08-25 06:30:34)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#5 2015-08-24 22:37:21

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

Again, same think dude , tons of errors..

Offline

#6 2015-08-25 06:30:07

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

ZoLA wrote:

Again, same think dude , tons of errors..

Well, 'tons of errors'  is not helpful... they are the same errors you get before? If not post them. Which of the two options you used? Is your system fully updated? What is the output of the following commands?

$ uname -a
$ pacman -Qi wxgtk webkitgtk2 gtk2
$ wx-config --cxxflags --libs

However, let's try first using the option one: according to ldd, these are all the packages you need to install in order to compile the program using wx-config, make sure you have all of them installed:

$ ldd main | awk '{print $3}' | pacman -Qqo - | sort --unique
atk
bzip2
cairo
enchant
expat
fontconfig
freetype2
gcc-libs
gdk-pixbuf2
glib2
glibc
graphite
gst-plugins-base-libs
gstreamer
gtk2
harfbuzz
harfbuzz-icu
icu
libdrm
libffi
libgcrypt
libgpg-error
libice
libjpeg-turbo
libpng
libsecret
libsm
libsoup
libtiff
libutil-linux
libwebp
libx11
libxau
libxcb
libxcomposite
libxcursor
libxdamage
libxdmcp
libxext
libxfixes
libxi
libxinerama
libxml2
libxrandr
libxrender
libxshmfence
libxslt
libxt
libxxf86vm
mesa
mesa-libgl
orc
pango
pcre
pixman
sqlite
wayland
webkitgtk2
wxgtk
xz
zlib

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#7 2015-08-25 11:48:14

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

Errors: http://pastebin.com/SBAEsRHQ
Uname: http://pastebin.com/eBTRENQ3
I didn't have webkitgtk2 soo i installed: http://pastebin.com/kSa7ap8g
And wx-config: http://pastebin.com/QeXrKuxp

Last edited by ZoLA (2015-08-25 11:48:30)

Offline

#8 2015-08-25 13:43:36

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

From your last compilation log, it seems that the most of what you think are errors are just warnings and can be safely ignored (there is also a bug report for that, see https://bbs.archlinux.org/viewtopic.php?id=198385. It has been fixed recently so we probably have to wait until gcc 5.3 is out). The only error appears to be the following:

/usr/bin/ld: cannot find -lwx_gtk2u_wx-3.0
collect2: error: ld returned 1 exit status

I cannot find libwx_gtk2u_wx-3.0.so in any official package

$ pkgfile  /usr/lib/libwx_gtk2u_wx-3.0.so
$ 

and I don't understand why g++ tells ld to link that library since it is not in the options passed by wx-config... The output of wx-config is taken before or after you installed webkitgtk2? Can you please post the output of the following commad?

#  ldconfig -p | grep wx_gtk2u_

PS: Also, since you installed webkitgtk2 I assume you used only the first option, have you tried also the second option using the command I posted?

Last edited by mauritiusdadd (2015-08-25 13:43:49)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#9 2015-08-25 14:23:59

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

After webkitgtk2.. here is ldconfig : http://pastebin.com/KmQTvcrr

Offline

#10 2015-08-25 15:14:29

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

ZoLA wrote:

After webkitgtk2.. here is ldconfig : http://pastebin.com/KmQTvcrr

Everything seems alright there... Can you post the output of the compilation when using the --verbose options?

g++ --verbose main.cpp `wx-config --cxxflags --libs` -o main

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#11 2015-08-25 15:31:49

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

Here it is LINK: http://pastebin.com/jLhCGn5J
I just successfully compiled o.O and program with wxPuts("LOOL"); works.. but again with warnings..maybe gcc is problem now

Offline

#12 2015-08-25 16:10:44

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] wxWidgets

ZoLA wrote:

Here it is LINK: http://pastebin.com/jLhCGn5J
I just successfully compiled o.O and program with wxPuts("LOOL"); works..

Yeha, that looks good... maybe there was a typo in the command you used previously.

ZoLA wrote:

but again with warnings..maybe gcc is problem now

Indeed (read the link I posted in post #8), but as I previously said you can safely ignore them...
Please, remember to mark the thread as [SOLVED]: https://bbs.archlinux.org/viewtopic.php?id=130309


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#13 2015-08-25 17:38:23

ZoLA
Member
Registered: 2014-04-07
Posts: 22

Re: [SOLVED] wxWidgets

Thanks dude. I'll change thread name. See you

Offline

Board footer

Powered by FluxBB