Problem with makefile.unx when compiling opengl applications

Iulian-Nicu Serbanoiu undergraver at gmail.com
Tue Oct 3 03:51:07 PDT 2006


Hello,

wx2.6.1 - ubuntu ( the version from the ubuntu packages ) - used to compile
the samples from wx2.6.3


ins at ins-desktop:~/Desktop/downloads/wxWidgets-2.6.3/samples/opengl/isosurf$
make -f makefile.unx
g++ -c `wx-config --cxxflags` -o isosurf.o isosurf.cpp
g++ -o isosurf isosurf.o `wx-config --libs` -lwx_gtk_gl -lGL -lGLU
/usr/bin/ld: cannot find -lwx_gtk_gl
collect2: ld returned 1 exit status
make: *** [isosurf] Error 1


I saw that in wx-config there is the option --gl_libs but when typing
wx-config it is not displayed:

root at ins-desktop:/etc/ppp# wx-config

 wx-config [--prefix[=3DDIR]] [--exec-prefix[=3DDIR]] [--release]
[--version-full]
           [--list] [--host=3DHOST] [--toolkit=3DTOOLKIT] [--universal[=3Dy=
es|no]]
           [--unicode[=3Dyes|no]] [--debug[=3Dyes|no]] [--static[=3Dyes|no]]
           [--version[=3DVERSION]] [--basename] [--cc] [--cppflags] [--cfla=
gs]
           [--cxxflags] [--rezflags] [--libs] [--cxx] [--ld] [--linkdeps]
           [--utility=3DUTIL] [LIB ...]

   wx-config returns  information about  the wxWidgets libraries available
   on your system.  It may be used to retrieve the information you require
   to build applications using these libraries.

    If alternative builds of wxWidgets exist on the system, you can use the
  options:  --prefix,  --host,  --toolkit,  --unicode,  --debug,  --static,
  --version and --universal, to select from them.  Use the --list option to
  show alternatives available which match specified criteria.   The unicode,
  debug, and universal options  take an  optional yes or no  argument, while
  host and version  accept posix extended regex.   The --utility option will
  return the correct version of UTIL to use with the selected library build.
  --linkdeps returns only static libraries for your makefile link rule deps.

    Optional LIB arguments (comma or space separated) may be used to specify
  the wxWidgets libraries that  you wish  to use.  The magic "std" label may
  be used to import all libraries that would be used by default if none were
  specified explicitly.  eg. wx-config --libs core,base.

root at ins-desktop:/etc/ppp#

So I think that those makefiles should be modified and the wx-config script
should be added
some help text that describes the command line parameters needed to obtain
the name of the
opengl library ( --gl_libs option in this case )

in the makefile.unx of the "samples/opengl" examples:

Instead of:

$(PROGRAM):     $(OBJECTS)
        $(CXX) -o $(PROGRAM) $(OBJECTS) `wx-config --libs` -lwx_gtk_gl
$(OPENGL_LIBS)

it should be:

$(PROGRAM):     $(OBJECTS)
        $(CXX) -o $(PROGRAM) $(OBJECTS) `wx-config --libs --gl_libs`
$(OPENGL_LIBS)


Regards,

Iulian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20061003/795=
62ef4/attachment.htm


More information about the wx-users mailing list