openGL compilation failure

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
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3467
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

openGL compilation failure

Post by ONEEYEMAN » Thu Jan 10, 2019 5:32 am

Hi, ALL,
I I just tried to compile wxWidgets-3.1 on Oracle Solaris 11.4 with Solaris Studio 12.6

Code: Select all

/export/home/igor/wxWidgets/buildSol/bk-deps CC -c -o gldll_glx11.o  -D__WXGTK__        -DWXBUILDING       -I../src/regex   -DWXUSINGDLL -DWXMAKINGDLL_GL -KPIC -DPIC   -D_FILE_OFFSET_BITS=64 -I/export/home/igor/wxWidgets/buildSol/lib/wx/include/gtk3-unicode-3.1 -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng14 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng14 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -D_REENTRANT -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -I/usr/openwin/include -mt -D_REENTRANT -g -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -I/usr/include/freetype2 -I/usr/include/libpng14 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng14 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng14 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng14 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -D_REENTRANT -I/usr/include/libsecret-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pcre -features=tmplife -std=c++11 ../src/unix/glx11.cpp
"../src/unix/glx11.cpp", line 75: Error: Multiple declaration for PFNGLXCREATECONTEXTATTRIBSARBPROC.
1 Error(s) detected.
*** Error code 2
make: Fatal error: Command failed for target `gldll_glx11.o'
The configure line was: ../configure --enable-debug --with-gtk=3.

I don't know anything about OpenGL, so don't even know what to do here...


I can try to test fixes to the compilation

Thank you.

Manolo
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 698
Joined: Mon Apr 30, 2012 11:07 pm

Re: openGL compilation failure

Post by Manolo » Thu Jan 10, 2019 6:24 pm

To get OpenGL lib you need to use --with-opengl in your ../configure command.

The weird thing is your log shows it's trying to compile the right file (../src/unix/glx11.cpp), but spits a redeclaration of PFNGLXCREATECONTEXTATTRIBSARBPROC. This has never been a bug, as this declaration should be unique.

Do you have a customized file? I mean, it includes some other GL-stuff with this decalaration.
Last edited by Manolo on Thu Jan 10, 2019 7:05 pm, edited 2 times in total.

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

Re: openGL compilation failure

Post by ONEEYEMAN » Thu Jan 10, 2019 6:59 pm

Hi, Manolo,
Manolo wrote: To get OpenGL lib you need to use --with-opengl in your ../configure command.
I think this option is set by default.
Manolo wrote: The weird thing is your log shows it's trying to compile the right file (../src/unix/glx11.cpp), but spits a redeclaration of PFNGLXCREATECONTEXTATTRIBSARBPROC. This has never been a bug, as this declaration should be unique.

Do you have a customized file? I mean, it includes some other GL-stuff with this decalaration.
No, this is a standard wxWidgetsz-3.1 source code. No changes at all.
However, the install is in the VirtualBox machine on Windows.

I sent an E-mail to the Solaris ML. Here is the reply:
If you are using non-NVIDIA graphics you may also be including
the MESA headers where glxext.h has the same typedef:

typedef GLXContext ( *PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy,
GLXFBConfig config, GLXContext share_context, Bool direct, const int
*attrib_list);

Does you build include glxext.h?
Following the code all I see is inclusion of GL/glx.h from include/wx/unix/glx11.h. Maybe on Solaris this file includes extension?

I will check later today and reply.

I will also post the relevant info from the Solaris ML discussion.

Thank you.

Manolo
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 698
Joined: Mon Apr 30, 2012 11:07 pm

Re: openGL compilation failure

Post by Manolo » Thu Jan 10, 2019 7:05 pm

OK. I see the same typedef in the OS GL/glxext.h file, which may be included from also OS GL/gl.h.

Thus, we can have a bug at ../src/unix/glx11.cpp. Try MOVING the whole typedef (lines 72-75) into the contiguous #ifndef GLX_ARB_create_context block (lines 77-84). If it works, a PR must be submitted to wxTrack.

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

Re: openGL compilation failure

Post by ONEEYEMAN » Thu Jan 10, 2019 7:22 pm

Hi, Manolo,
So you see it in the Linux/gcc implementation as well?

I will try to check it tonight and let you know.

Thank you.

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

Re: openGL compilation failure

Post by ONEEYEMAN » Fri Jan 11, 2019 2:06 am

Hi, Manolo,
Moving this inside that block makes it compile.
You should definitely submit this as a fix.

Thank you.

Post Reply