Maybe this is wxGTK pkg-config's file bug (should it contain -lGL -lGLU?). I've failed to find any normal way to add linking into erlang's wx build-system, it's some kind of mess, so, handling this in wxGTK's pkg-config will be much easier, but I don't know about correctness of such way. Reproducible: Always Steps to Reproduce: 1. erl 2. wx:new(). Actual Results: WX Failed loading "wxe_driver"@"/usr/lib64/erlang/lib/wx-0.98.5/priv/x86_64-pc-linux-gnu" ** exception error: {load_driver,"undefined symbol: gluNewTess"} Expected Results: wx handler returned. Portage 2.2_rc85 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r5-nord-fglrx-1.4 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-2.6.35-gentoo-r5-nord-fglrx-1.4-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T6600_@_2.20GHz-with-gentoo-2.0.1 Timestamp of tree: Fri, 24 Sep 2010 22:45:01 +0000 distcc 3.1 x86_64-pc-linux-gnu [disabled] ccache version 2.4 [disabled] app-shells/bash: 4.1_p7 dev-java/java-config: 2.1.11 dev-lang/python: 2.6.5-r3, 3.1.2-r4 dev-util/ccache: 2.4-r8 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.6.3 sys-apps/sandbox: 2.3-r1 sys-devel/autoconf: 2.13, 2.67 sys-devel/automake: 1.4_p6-r1, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.4-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.35 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native -mtune=native -msse4.1 -floop-interchange -floop-strip-mine -floop-block" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe -march=native -mtune=native -msse4.1 -floop-interchange -floop-strip-mine -floop-block" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--keep-going --jobs=2" FEATURES="assume-digests candy distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="ru_RU.UTF-8" LC_ALL="ru_RU.UTF-8" LDFLAGS="-Wl,--as-needed -Wl,--sort-common -Wl,-O1 -Wl,--hash-style=gnu" LINGUAS="ru" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/rion /var/lib/layman/enlightenment-niifaq /var/lib/layman/niifaq /var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/kde-sunset /var/lib/layman/science /var/lib/layman/vmware /usr/local/portage" SYNC="rsync://rsync.niifaq.ru/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm hal iconv idn ipv6 jpeg lcms ldap libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt3support qt4 readline reflection sdl session spell sse sse2 ssl ssse3 startup-notification svg sysfs tcpd threads tiff truetype unicode usb vim vim-syntax vorbis x264 xcb xcomposite xml xorg xulrunner xv xvid zlib zsh-completion" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" RUBY_TARGETS="ruby18" SANE_BACKENDS="net" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= dev-lang/erlang-13.2.4 was built with the following: USE="doc emacs kpoll (multilib) smp ssl wxwidgets -hipe -java -odbc -sctp -tk" CFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block" CXXFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block" x11-libs/wxGTK-2.8.11.0 was built with the following: USE="X doc gnome (multilib) opengl sdl tiff -debug -gstreamer -odbc -pch" CFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block -fno-strict-aliasing" CXXFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block -fno-strict-aliasing" x11-libs/wxGTK-2.9.1 was built with the following: USE="X doc gnome (multilib) opengl sdl tiff -debug -gstreamer -pch" CFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block -fno-strict-aliasing" CXXFLAGS="-O2 -pipe -march=core2 -mtune=core2 -msse4.1 -floop-interchange -floop-strip-mine -floop-block -fno-strict-aliasing"
Wxwindows team, can you advise?
Looks like the problem is that when linking with --as-needed libGLU.so isn't kept around in the NEEDED section of libwx_gtk2u_gl-2.8.so. erlang will have to explicitly link to it if it uses it.
Just adding -lGLU to the two LIBS lines in lib/wx/c_src/Makefile.in will do it.
This seems to be fixed in the 14.2 release which I just bumped to the tree. Andrian, if the problem still exists, please tell me here.
Erlang R14B ... 1> wx:new(). =ERROR REPORT==== 24-Nov-2010::00:33:32 === WX Failed loading "wxe_driver"@"/usr/lib64/erlang/lib/wx-0.98.7/priv/x86_64-pc-linux-gnu" ** exception error: {load_driver,"undefined symbol: gluNewTess"} Still valid, ldd shows no linking with libGLU. Are you using -Wl,--as-needed?
For whatever reason I could not reproduce before...it is now fixed in 14.2-r1 and reported upstream.
It's worked, thanks. About reason: I don't know, while I was trying to fix this error by myself, I've got only one thing - their build system is a mess and absolutely anything could happen there. Thanks again.