wxWidgets-3.1.5: can´t build wxgl

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.
BlackMage
In need of some credit
In need of some credit
Posts: 6
Joined: Sun May 30, 2021 10:40 pm

wxWidgets-3.1.5: can´t build wxgl

Post by BlackMage » Sun May 30, 2021 11:00 pm

i can´t compile wxWidgets-3.1.5. 'Target "wxgl" links to target "OpenGL::EGL" but the target was not found.' says cmake. i use Cygwin
and i have 19.1.6-1 versions of libEGL-devel and libGL-devel installed.

cmake version: 3.20.0
OS: Windows 10 Version 1809

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

Re: wxWidgets-3.1.5: can´t build wxgl

Post by ONEEYEMAN » Mon May 31, 2021 1:24 pm

Hi,
What is wxgl?
Are you trying to build the library or some user code?

Please explain exactly what you did?

Thank you.

BlackMage
In need of some credit
In need of some credit
Posts: 6
Joined: Sun May 30, 2021 10:40 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by BlackMage » Mon May 31, 2021 4:22 pm

i will build wxWidgets 3.1.5 with wxgl support, but when i use -DwxUSE_OPENGL=1 only the message comes: '"Target" wxgl "links to target" OpenGL :: EGL "but the target was not found.
Perhaps a find_package () call is missing for an IMPORTED target, or an
ALIAS target is missing? "
I get the rest of the libraries compiled.

I ask why? the OpenGL libraries (libGL1 libGL-devel libEGL1 libEGL1-devel libGLEW2 libGLEW2-devel libGLU-devel libGLU1) are all installed in Cygwin.. What libraries need wxgl for compiling?

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

Re: wxWidgets-3.1.5: can´t build wxgl

Post by ONEEYEMAN » Mon May 31, 2021 4:35 pm

BlackMage wrote:
Mon May 31, 2021 4:22 pm
i will build wxWidgets 3.1.5 with wxgl support,
How did you build it?
And I presume it built successfully?
BlackMage wrote:
Mon May 31, 2021 4:22 pm
but when i use -DwxUSE_OPENGL=1 only the message comes: '"Target" wxgl "links to target" OpenGL :: EGL "but the target was not found.
Are you trying to build your own code here?
BlackMage wrote:
Mon May 31, 2021 4:22 pm
Perhaps a find_package () call is missing for an IMPORTED target, or an
ALIAS target is missing? "
I get the rest of the libraries compiled.
Perhaps, but we need more info from you...
BlackMage wrote:
Mon May 31, 2021 4:22 pm
I ask why? the OpenGL libraries (libGL1 libGL-devel libEGL1 libEGL1-devel libGLEW2 libGLEW2-devel libGLU-devel libGLU1) are all installed in Cygwin.. What libraries need wxgl for compiling?
Thank you.

BlackMage
In need of some credit
In need of some credit
Posts: 6
Joined: Sun May 30, 2021 10:40 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by BlackMage » Tue Jun 01, 2021 5:55 pm

i try to build all libs of wxWidgets-3.1.5, which also works so far, except for the wxGL library, because the OpenGL :: EGL target was not found there ..
and I don't know why the target was not found, all opengl libs are installed in cygwin, I do not know how to continue
that's really just about me, why are the egl libs not found?

User avatar
doublemax
Moderator
Moderator
Posts: 16200
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWidgets-3.1.5: can´t build wxgl

Post by doublemax » Tue Jun 01, 2021 6:01 pm

Could you try with wx 3.1.4?

One of the new things added in 3.1.5 was:
wxGTK:
- Implement EGL-based wxGLCanvas for Wayland (Scott Talbert).
Maybe this is a configuration error in the make files. I've never heard of "EGL" under Windows before.
Use the source, Luke!

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

Re: wxWidgets-3.1.5: can´t build wxgl

Post by ONEEYEMAN » Wed Jun 02, 2021 5:10 pm

Hi,
Are you building using configure script?
Can you check the config.log file that is produced inside the folder where you ran configure from amd see what happening?
Also - what parameters did you supply to configure (if you are building with configure)? What is the exact configure line you used?
If not - how are trying to build wxWidgets?

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 468
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by stahta01 » Wed Jun 02, 2021 9:23 pm

I duplicated what I think the OP did; this is guesswork.

The commands I used.

Code: Select all

mkdir -p ~/devel/wxWidgets/build_cmake_cygwin64   && \
cd ~/devel/wxWidgets/build_cmake_cygwin64         && \
cmake ~/devel/wxWidgets -DwxBUILD_SAMPLES=ALL     && \
sed --in-place "s/define wxUSE_FSWATCHER 1/define wxUSE_FSWATCHER 0/" lib/wx/include/gtk3-unicode-3.1/wx/setup.h  && \
sed --in-place "s/define wxUSE_DIALUP_MANAGER 1/define wxUSE_DIALUP_MANAGER 0/" lib/wx/include/gtk3-unicode-3.1/wx/setup.h  && \
sed --in-place "s/define wxUSE_JOYSTICK 1/define wxUSE_JOYSTICK 0/" lib/wx/include/gtk3-unicode-3.1/wx/setup.h  && \
cmake --build . 
The important part of the response below

Code: Select all

-- Which libraries should wxWidgets use?
    wxUSE_STL:        OFF      (use C++ STL classes)
    wxUSE_REGEX:      builtin  (enable support for wxRegEx class)
    wxUSE_ZLIB:       sys      (use zlib for LZW compression)
    wxUSE_EXPAT:      sys      (use expat for XML parsing)
    wxUSE_LIBJPEG:    builtin  (use libjpeg (JPEG file format))
    wxUSE_LIBPNG:     sys      (use libpng (PNG image format))
    wxUSE_LIBTIFF:    builtin  (use libtiff (TIFF file format))
    wxUSE_LIBLZMA:    OFF      (use liblzma for LZMA compression)
    wxUSE_LIBSDL:     OFF      (use SDL for audio on Unix)
    wxUSE_LIBMSPACK:  OFF      (use libmspack (CHM help files loading))

-- Configured wxWidgets 3.1.6 for CYGWIN-3.2.0(0.340/5/3)
    Min OS Version required at runtime:                Windows XP / Windows Server 2003 (x64 Edition)
    Which GUI toolkit should wxWidgets use?            gtk3 3.22.28
    Should wxWidgets be compiled into single library?  OFF
    Should wxWidgets be linked as a shared library?    ON
    Should wxWidgets support Unicode?                  ON
    What wxWidgets compatibility level should be used? 3.0
-- Configuring done
CMake Error at build/cmake/functions.cmake:368 (add_library):
  Target "wxgl" links to target "OpenGL::OpenGL" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  build/cmake/lib/gl/CMakeLists.txt:26 (wx_add_library)


CMake Error at build/cmake/functions.cmake:368 (add_library):
  Target "wxgl" links to target "OpenGL::EGL" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
Call Stack (most recent call first):
  build/cmake/lib/gl/CMakeLists.txt:26 (wx_add_library)
It is likely an cmake file needs edited to find the OpenGL installation.
Note: If the original poster (OP) does not wish to build the wxWidgets OpenGL library; I am willing to see if there is a easy way to disable building it.

Tim S.

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

Re: wxWidgets-3.1.5: can´t build wxgl

Post by ONEEYEMAN » Wed Jun 02, 2021 9:28 pm

Tim,
If (s)he builds with CMake.
But building with configure might produce different results...
Hence my questions of the means (s)he builds the library with...

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 468
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by stahta01 » Wed Jun 02, 2021 10:10 pm

The first post says cmake gave the error.
Edit3: Now we have no idea if the error was from building wxWidget or client code using wxWidgets.

wxgl requires the mesa library to build wxGTK under cygwin native GCC and having some of the other openGL libs installed confused cmake.

Edit4: We have no idea if the OP is building wxGTK using cygwin native GCC.

cmake has made it past the configure step after I installed "mesa" and removed the other gl libs except for "libGL1" and "libGL-devel".

Edit5: Cygwin has finished building wxGTK and I have confirmed the file "cygwx_gtk3u_gl-3.1.dll" exists.

Edit 6
Built with git master
commit 5dbdada6aab0c432e490459c92a5a77ac1d595d8
Date: Thu May 27 23:54:07 2021 +0200
gcc (GCC) 10.2.0
Windows 7

Tim S.

BlackMage
In need of some credit
In need of some credit
Posts: 6
Joined: Sun May 30, 2021 10:40 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by BlackMage » Thu Jun 03, 2021 4:37 am

okay, with configure occurs no Error(cmake´s opengl detection is bad on cygwin?)

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 468
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by stahta01 » Thu Jun 03, 2021 4:40 am

ONEEYEMAN wrote:
Wed Jun 02, 2021 9:28 pm
Tim,
If (s)he builds with CMake.
But building with configure might produce different results...
Hence my questions of the means (s)he builds the library with...

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 468
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by stahta01 » Thu Jun 03, 2021 4:47 am

BlackMage wrote:
Thu Jun 03, 2021 4:37 am
okay, with configure occurs no Error(cmake´s opengl detection is bad on cygwin?)
That makes no sense to me; when, you fail to state what you did, it is hard to help you.

If you install the wrong packages it is not cmake's fault that it is confused.

What compiler are you using?

Are you trying to build wxGTK? If not what are you trying to build.

Are you getting the error building wxWidgets ( wxGTK, wxMSW, or other)?

Are you instead getting the error trying to build client code that uses wxWidgets?

Is there a good reason why you are using Cygwin to try to build wxWidgets library or client code?

Tim S.

BlackMage
In need of some credit
In need of some credit
Posts: 6
Joined: Sun May 30, 2021 10:40 pm

Re: wxWidgets-3.1.5: can´t build wxgl

Post by BlackMage » Thu Jun 03, 2021 6:17 am

okay, now i build the library with './configure --with-gtk --with-regex=sys --with-opengl --enable-compat28 --with-sdl --enable-stl --with-libmspack' (a GTK3 build so)
the building works well, it took a while to find the optimal options for me
i build the library only for my Development and Testing..

I had to experiment a lot with installing GL Libs until I found a working configuration
but in the end I found an optimal solution. Thanks everyone for their help. :D

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

Re: wxWidgets-3.1.5: can´t build wxgl

Post by ONEEYEMAN » Thu Jun 03, 2021 12:44 pm

Hi,
Do you really need 28 compatibility?
wx-28 is really old and it is not what you want in 99% of the cases.

Thank you.

Post Reply