Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98570 - wxWidgets not enabling wxUSE_STD_IOSTREAM
Summary: wxWidgets not enabling wxUSE_STD_IOSTREAM
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High blocker
Assignee: Gentoo wxWidgets project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-10 09:10 UTC by Tommy McDaniel
Modified: 2006-04-23 03:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Sample file that doesn't compile (wxtest.cpp,319 bytes, text/plain)
2005-07-10 09:13 UTC, Tommy McDaniel
Details
config.log (config.log,188.54 KB, text/x-log)
2006-04-18 16:04 UTC, Tommy McDaniel
Details
configure output (emerge_configure_output,29.39 KB, text/plain)
2006-04-18 16:08 UTC, Tommy McDaniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy McDaniel 2005-07-10 09:10:27 UTC
As mentioned at http://wxwidgets.org/manuals/2.6.1/wx_wxlogstream.html, some    
wxWidgets features require that wxWidgets be built with standard C++ streams    
support, which sets the flag wxUSE_STD_IOSTREAM to 1. Currently, Gentoo's    
wxWidgets is not built with said support, and thus, compiling wxWidgets    
programs that use such features fails. There is a ./configure switch that can   
be used to enable this when building wxWidgets. I will attach a sample file 
that displays the compilation error. 

Reproducible: Always
Steps to Reproduce:
1. Install wxWidgets using Portage. 
2. Try to compile a wxWidgets program using the wxLogStream class. 
3. Watch the compilation go up in flames. 
 
Actual Results:  
Compilation fails, with messages "error: ISO C++ forbids declaration of 
`wxLogStream' with no type" and "error: `wxLogStream' has not been declared". 

Expected Results:  
Compiled correctly (if wxWidgets had been built properly; as currently built, 
it's supposed to fail). 

Portage 2.0.51.22-r1 (default-linux/amd64/2005.0, gcc-3.4.3, 
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r11 x86_64) 
================================================================= 
System uname: 2.6.11-gentoo-r11 x86_64 AMD Opteron(tm) Processor 246 
Gentoo Base System version 1.6.12 
dev-lang/python:     2.3.5 
sys-apps/sandbox:    1.2.9 
sys-devel/autoconf:  2.13, 2.59-r6 
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 
sys-devel/binutils:  2.15.92.0.2-r10 
sys-devel/libtool:   1.5.18-r1 
virtual/os-headers:  2.6.11-r2 
ACCEPT_KEYWORDS="amd64" 
AUTOCLEAN="yes" 
CBUILD="x86_64-pc-linux-gnu" 
CFLAGS="-march=opteron -O3 -pipe" 
CHOST="x86_64-pc-linux-gnu" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-march=opteron -O3 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoconfig distlocks sandbox sfperms strict" 
GENTOO_MIRRORS="http://distfiles.gentoo.org 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo" 
LANG="en_US.utf8" 
LC_ALL="en_US.utf8" 
MAKEOPTS="-j3" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="amd64 X Xaw3d a52 aac aalib accessibility acl acpi adns aim alsa apache2 
arts audiofile avi bash-completion bcmath berkdb bidi bitmap-fonts bluetooth 
bmp bonobo bzlib calendar canna cdb cdparanoia cdr chasen cjk crypt cscope 
ctype cups curl curlwrappers db2 dba dbase dbm dbx dedicated dga dio directfb 
doc dv dvb dvd dvdr dvdread eds emacs emacs-w3 emul-linux-x86 encode esd 
ethereal evo examples exif expat fam fastcgi fbcon ffmpeg flac flash flatfile 
font-server foomaticdb fortran freetds freewnn ftp gb gcj gd gdbm geoip ggi gif 
ginac glut gmp gnome gnustep gnutls gphoto2 gpm gps gstreamer gtk gtk2 gtkhtml 
guile hal hardened hardenedphp howl hyperwave-api iconv icq imagemagick imap 
imlib inifile innodb interbase iodbc ipv6 jabber jack javascript joystick jp2 
jpeg kde kerberos krb4 ladcca lcms ldap leim libcaca libg++ libgda libwww lirc 
lm_sensors lzw lzw-tiff m17n-lib mad maildir mailwrapper matroska mbox mcal 
mcve memlimit mhash migemo mikmod milter mime ming mmap mng mnogosearch motif 
mozilla mp3 mpeg mpi msession msql mssql mule mysql mysqli nas ncurses neXt 
netcdf nis nls nocd nptl oci8 odbc offensive ofx ogg openal opengl oracle 
oracle7 osc oscar oss ovrimos pam pcntl pcre pda pdflib perl php plotutils png 
portaudio posix postgres ppds prelude python qdbm qt quicktime readline recode 
ruby samba sapdb sasl scanner sdl session sharedext sharedmem shorten simplexml 
skey slang smartcard sndfile snmp soap sockets socks5 source sox speex spell 
spl sqlite ssl svg symlink sysvipc szip tcltk tcpd tetex theora threads tidy 
tiff tokenizer truetype truetype-fonts type1-fonts unicode usb userlocales v4l 
vcd vhosts videos vorbis wddx wifi wmf wxwindows xface xine xml xml2 xmlrpc 
xmms xosd xpm xprint xrandr xsl xv xvid yahoo yaz zeo zlib userland_GNU 
kernel_linux elibc_glibc" 
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Tommy McDaniel 2005-07-10 09:13:07 UTC
Created attachment 63075 [details]
Sample file that doesn't compile

Try to compile with: g++ `wx-config --cxxflags --libs` -o wxtest wxtest.cpp

My output is:

wxtest.cpp:11: error: ISO C++ forbids declaration of `wxLogStream' with no type

wxtest.cpp:11: error: expected `;' before '*' token
wxtest.cpp: In member function `virtual bool App::OnInit()':
wxtest.cpp:17: error: `log_stream_ptr' undeclared (first use this function)
wxtest.cpp:17: error: (Each undeclared identifier is reported only once for
each function it appears in.)
wxtest.cpp:17: error: `wxLogStream' has not been declared
Comment 2 Mart Raudsepp gentoo-dev 2006-04-10 16:04:51 UTC
wxUSE_STD_IOSTREAM is default in 2.6.1.
Just not in case of cygwin, mingw32, os2, darwin and macos as I read out of 2.6.2's configure.in, and I recall this changing prior to 2.6.0 (wxUSE_STD_IOSTREAM becoming the default).
Could you take a look at config.log, configure output for relevant bits and/or attach em here?
Comment 3 Mark Loeser (RETIRED) gentoo-dev 2006-04-17 17:49:15 UTC
Please reopen the bug when you post the information Mart asked for (if this is still a problem)
Comment 4 Tommy McDaniel 2006-04-18 15:58:12 UTC
I still have the same problem, with wxGTK-2.6.2-r1. I couldn't think of an especially smooth way to get the requested information, so I just started the emerge and hit Ctrl-C when it started compiling files. If that was a no-no and there's a more-correct way to get the information, just let me know. I'll attach the goods following this comment.
Comment 5 Tommy McDaniel 2006-04-18 16:04:07 UTC
Created attachment 84930 [details]
config.log

This is /var/tmp/portage/wxGTK-2.6.2-r1/work/wxWidgets-2.6.2/gtk2_build/config.log.
Comment 6 Tommy McDaniel 2006-04-18 16:08:58 UTC
Created attachment 84931 [details]
configure output

Copied and pasted from the beginning of the emerge until right before it started compiling.
Comment 7 Mart Raudsepp gentoo-dev 2006-04-18 19:20:54 UTC
Ok, from the logs I can see this:

checking for --enable-std_iostreams... yes
checking iostream usability... yes
checking iostream presence... yes
checking for iostream... yes
checking for std::istream... yes
checking for std::ostream... yes
| #define wxUSE_STD_IOSTREAM 1
ac_cv_use_std_iostreams=wxUSE_STD_IOSTREAM=yes

## ----------- ##
## confdefs.h. ##
## ----------- ##
<snip>
#define wxUSE_STD_IOSTREAM 1

wxUSE_STD_IOSTREAM you are definately getting enabled...
Does that not show in gtk2_build/lib/wx/include/gtk2-ansi-release-2.6/wx/setup.h, or what?
Or is the problem something completely different?
Perhaps you are picking up wx-2.4 headers - do you have wxGTK-2.4 installed too (they can co-exist)? You could use "equery l wxGTK" for that (small L) and see if it outputs more than one wxGTK.
Comment 8 Tommy McDaniel 2006-04-20 04:50:38 UTC
Well I'll be. That equery command you mentioned returned this:

[ Searching for package 'wxGTK' in all categories among: ]
 * installed packages
[I--] [M ] x11-libs/wxGTK-2.4.2-r3 (2.4)
[I--] [  ] x11-libs/wxGTK-2.6.2-r1 (2.6)

I don't know what the M means, but apparently there are two wxGTK versions installed. So I got to pondering whether wx-config was using the old version. It turns out that it is. For the new version, you have to use wx-config-2.6, which I didn't even know existed. I tried compiling using that, and it worked. I guess the "problem" is with the confusing way that the config programs are named. We can presumably close this bug.
Comment 9 Mart Raudsepp gentoo-dev 2006-04-20 05:00:45 UTC
(In reply to comment #8)
> Well I'll be. That equery command you mentioned returned this:
> 
> [ Searching for package 'wxGTK' in all categories among: ]
>  * installed packages
> [I--] [M ] x11-libs/wxGTK-2.4.2-r3 (2.4)
> [I--] [  ] x11-libs/wxGTK-2.6.2-r1 (2.6)
> 
> I don't know what the M means,

I think that in this case it means that the ebuild doesn't exist in portage anymore (we are at 2.4.2-r4 now). Sounds like it would mean "hard masked" otherwise.

> but apparently there are two wxGTK versions installed.

They are slotted different, so you probably had wxGTK-2.4 from old times.

> So I got to pondering whether wx-config was using the old version.
> It turns out that it is. For the new version, you have to use wx-config-2.6,
> which I didn't even know existed. I tried compiling using that, and it worked.

Yeah, it picked up old 2.4 headers where wxUSE_STD_IOSTREAM wasn't the default.

> I guess the "problem" is with the confusing way that the config programs are
> named. We can presumably close this bug.

We need to think how to solve the wx-config issues that seem to come up. All seems sorted not too bad for wx applications installed through ebuilds, where the eclass helps the ebuild select which wx version and wx-config to use, but users compiling wx apps on their own end up using some random wx-config symlink.

My own goal is to just get rid of wxGTK-2.4 from the tree after ensuring nothing needs it if that works out, but that doesn't people to uninstall the old slotted 2.4, IIRC.
Comment 10 Mark Loeser (RETIRED) gentoo-dev 2006-04-20 20:59:16 UTC
Alright, so this isn't really a problem, and at a future date we can address the wx-config stuff.

Thanks :)
Comment 11 Tommy McDaniel 2006-04-23 00:17:33 UTC
We could use the format wx-config-VERSION for every version of wx-config. Or we could let the most recent one be called wx-config and make older ones have version numbers. Or we could do the first thing and add a plain wx-config symlink that always points to the most recent one. Then there's the possibility that all my ideas just plain suck. Surely we're not the only people who have ever had to deal with this, so maybe we can see how the problem has been solved successfully before.
Comment 12 Mart Raudsepp gentoo-dev 2006-04-23 03:29:58 UTC
We already have multiple wx-config files with changed names:

/usr/lib/wx/config/gtk2-{ansi,unicode}-{debug,release}-2.<minor ver>
/usr/bin/wx-config-2.<minor ver>
/usr/bin/wx-config

The problem is that wx-config is used by applications either directly or through wxwin.m4 aclocal macros. While we select the correct config out of /usr/lib/wx/config when installing a wx application through an ebuild with the help of the eclass, applications compiled manually use wx-config (and they are supposed to), and that symlink is a rather random one. Probably whatever slotted wx was installed the latest.
That's what we need to take care of.
I don't really want to suggest an eselect module here.
But anyhow, I have this in horizon, but a specialized bug report on this might be useful.