Can't compile the minimal sample

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
kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Can't compile the minimal sample

Post by kagi3624 » Wed Feb 26, 2020 8:26 am

Hello,

I was just finished compiling 3.1.3 on my Ubuntu 19.10. I used this tutorial with the option A and other than opengl i didn't add anything else to the configuration. But now when I try to compile the minimal example I get the following error:

Code: Select all

$make
g++ -o minimal  minimal_minimal.o    -L/home/roman/Downloads/wxWidgets-3.1.3/gtk-build/lib  -Wl,-rpath,/home/roman/Downloads/wxWidgets-3.1.3/gtk-build/lib -pthread     -lwx_gtk3u_core-3.1  -lwx_baseu-3.1    -lwxtiff-3.1 -lwxjpeg-3.1   -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 -pthread -lgthread-2.0 -lglib-2.0 -lX11 -lXxf86vm -lSM -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 -lXtst -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lpng -lz  -lwxregexu-3.1  -pthread   -Wl,--version-script,/home/roman/Downloads/wxWidgets-3.1.3/gtk-build/version-script -lz -ldl -lm  -lz -ldl -lm
/usr/bin/ld: cannot find -lwxtiff-3.1
/usr/bin/ld: cannot find -lwxjpeg-3.1
/usr/bin/ld: cannot find -lwxregexu-3.1
collect2: error: ld returned 1 exit status
make: *** [Makefile:149: minimal] Error 1
I have run the sudo ldconfig command..but other than asking for my sudo pw nothing happens there...so I don't know if it was successful or not.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4265
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Can't compile the minimal sample

Post by ONEEYEMAN » Wed Feb 26, 2020 4:34 pm

Hi,
So what you did was:

Code: Select all

cd ~/wxWidgets/build-gtk/samples/minimal
make
right?

My question then would be - how did you get the source? And did you get any compilation errors during the build/configure phases?

Thank you.

kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Re: Can't compile the minimal sample

Post by kagi3624 » Wed Feb 26, 2020 5:20 pm

I got it from the wxwidget.org download page and I didn't notice any errors during the build. I followed the tutorial to this point and wx-config --version says that I have 3.1.3 installed.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4265
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Can't compile the minimal sample

Post by ONEEYEMAN » Wed Feb 26, 2020 6:01 pm

Hi,
Do you have a libwxtiff-3.1, libwxjpeg-3.1 and libwxregexu-3.1 on the system?
Specifically inside the /home/roman/Downloads/wxWidgets-3.1.3/gtk-build/lib directory.

Thank you.

kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Re: Can't compile the minimal sample

Post by kagi3624 » Wed Feb 26, 2020 7:29 pm

Hello oneeyeman, I looked in the dir but there is only another folder called "wx" and since my config was set to shared libraries shouldn't they be in the default folders? Like I said, I only added opengl to the config and left everything else as it is. Just right now I am finished installing it on my laptop (another ubuntu configuration) and this time I have similar error but only one library is missing:

Code: Select all

/usr/bin/ld: cannot find -lwxregexu-3.1

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4265
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Can't compile the minimal sample

Post by ONEEYEMAN » Wed Feb 26, 2020 8:10 pm

Hi,
Why do you need to install it? Just use it in-place.
Meaning don't do "make install" after compiling.

I'd start over, making sure there is no errors on "configure" and during "make.
And then just do:

Code: Select all

cd ~/wxWidgets/build-gtk/samples/minimal && make
Also, since you are just starting, I strongly recommend to build debug version of the library and not a release one.

Thank you.

Post Reply