Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

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
fatalfeel
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Apr 05, 2019 7:36 pm

Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by fatalfeel » Fri Apr 05, 2019 7:45 pm

configure when happend
checking for GL/gl.h... yes
checking for GL/glu.h... yes
checking for -lGL... no
checking for -lMesaGL... no
configure: error: OpenGL libraries not available

1. download libglib2.0-dev form trusty-updates
https://packages.ubuntu.com/zh-tw/trust ... lib2.0-dev
dpkg --install ./libglib2.0-dev_2.40.2-0ubuntu1.1_amd64.deb

2. install libgtk2.0-dev
//select downgrade solution
aptitude install libgtk2.0-dev

//check it in console mode
pkg-config --cflags --libs gtk+-2.0

3. apt-get install libgl1-mesa-dev libglu1-mesa-dev

4.
cd /root/wxWidgets-2.8.12
gedit ./configure

find
SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed [email protected]@[email protected]` /usr/$wx_cv_std_libpath"
change to
SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed [email protected]@[email protected]` /usr/$wx_cv_std_libpath /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu"

5. release version
mkdir buildgtk
cd buildgtk
../configure --prefix=/opt/wxgtk --with-gtk --with-opengl --enable-unicode
make -j8 && make install

6.debug version
cd ..
mkdir buildgtkd
cd buildgtkd
../configure --prefix=/opt/wxgtkd --with-gtk --with-opengl --enable-unicode --enable-debug
make -j8 && make install

DavidHart
Site Admin
Site Admin
Posts: 3839
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by DavidHart » Fri Apr 05, 2019 9:00 pm

Hi,

I just 'Approved' your post, but to be honest I think it needs some added explanation.

The thread title says 'Can't compile...' but it also says 'Solved'. Do you mean that you were having a problem compiling, but managed to fix it yourself? If so, I suggest you edit the post to explain which bits are the problem and which the solution.

FWIW, there are other relevant threads e.g. viewtopic.php?f=19&t=39700.

Regards,

David

fatalfeel
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Apr 05, 2019 7:36 pm

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by fatalfeel » Sun Apr 07, 2019 4:56 pm

another way to solved

find /usr/openwin/share/include"

add 2 lines become to
/usr/openwin/share/include \
/usr/include/i386-linux-gnu \
/usr/include/x86_64-linux-gnu"

DavidHart
Site Admin
Site Admin
Posts: 3839
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by DavidHart » Sun Apr 07, 2019 6:34 pm

another way to solved
find /usr/openwin/share/include"
Why? Ubuntu trusty does not have a /usr/openwin so presumably you have installed it yourself.

Why do you keep doing things in unusual (wrong) ways, when there is a simple correct way? Please explain much more about why you are trying to do this.

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

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by ONEEYEMAN » Mon Apr 08, 2019 4:58 am

Hi,
As David said - there is no need to edit configure and there is no need to change any other autoconf scripts.

Please clearly explain what issue did you have and why it was not fixed by installing the standard wxWidgets from repository.

IOW, why did you need to compile it yourself.

Thank you.

fatalfeel
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Apr 05, 2019 7:36 pm

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by fatalfeel » Mon Apr 08, 2019 5:43 am

I download 2.8.12 stable version

but when i configure --with-opengl=2

gen the error

configure: error: OpenGL libraries not available
//

if no change configure, configure can not done

will stop configure and gen no Makefile

you can google this error~

https://stackoverflow.com/questions/817 ... -opengl-fl

DavidHart
Site Admin
Site Admin
Posts: 3839
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by DavidHart » Mon Apr 08, 2019 9:34 am

but when i configure --with-opengl=2
There is no parameter to 'with-opengl'. That should be:
configure --with-opengl
gen the error
It's not an error; it's a message telling you that what you asked for cannot be done (because you forgot to install the opengl dependencies). From the wx2.8.12 configure.in:

Code: Select all

       if test "x$OPENGL_LIBS" = "x"; then
            dnl it should be an error and not a warning because OpenGL is not on
            dnl by default and so if it had been explicitly requested, we
            dnl shouldn't just fall back to compiling the library without it
            AC_MSG_ERROR(OpenGL libraries not available)
        fi
Let me try to explain as simply as possible, to help you understand why you should stop doing wrong things and do the (easy) right things instead:
1) If you try to configure wx2.8.12 with opengl support, and you do not have the dependencies installed, you will get that message.
2) To fix the problem, you just need to install the missing libraries:
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
Then running configure --with-opengl should work.

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

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by ONEEYEMAN » Mon Apr 08, 2019 11:52 am

Hi,
2.8.12 is old. You should try to install 3.0 instead.
Multiple bugs are fixed. And newer, modern OpenGL support is implemented.

Thank you.

fatalfeel
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Apr 05, 2019 7:36 pm

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by fatalfeel » Tue Apr 16, 2019 7:43 pm

sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev not enough

still gen the error so need edit the configure I tried it in real ubuntu 14.04.5 not vmware

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

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by ONEEYEMAN » Tue Apr 16, 2019 7:51 pm

Hi,
Could you please grab the latest 3.1.1 version of the library and retry.
Post an exact error if you get any.

Also, saying "still gen the error" is not enough.
What is an exact error you received?

Also, are you trying to cross-compile wxWidgets to some other architecture (not PC)? ARM maybe?

And finally please explain why you are refusing to get the latest 3.1.1 (or 3.0 latest stable) version to try...

Thank you.

DavidHart
Site Admin
Site Admin
Posts: 3839
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Can't compile wxWidgets 2.8 --with-opengl in ubuntu amd64 (Solved)

Post by DavidHart » Tue Apr 16, 2019 9:32 pm

sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev not enough
still gen the error
What was the (relevant) configure output?

What is the (relevant) part of config.log? If you are not sure, please attach the whole of config.log to your post.

Post Reply