Discussion:
wxwidgets-linux: wxString
(too old to reply)
Peter Johann Brunner
2013-11-02 12:04:45 UTC
Permalink
I have wxGtk2 on 2 computers laptop and PC.
both AMD 64Bit Athlon / Turion X2
both Suse Linux 12.1 and wx-gtk2u-2.8.12-6.1.2-x86_64 from openSUSE
gcc is also the same 4.6.2_20111026-1.1.4-x86_64 from openSUSE

but compiling programs with wxString's there is a difference:

on the PC I get warnings when passing wxString_var.c_str() as parameter
to printf:
printf("%s", wxString_var.c_str());
equally likely I get errors by initializing wxStrings with cstrings:
wxString wxString_var = "sometext";
I must initialize with _T():
wxString wxString_var = _T("sometext");

on the laptop neither of the 2 messages appear!
and the program executes normally

I think there must be some different configuration of wx on the 2 computers.
But I can find nothing: e.g. wx-config's are identical.


further difference:

transferring the executable from laptop to PC and starting it, shows:
cannot open shared obj file libwx_gtk2_richtext-2.8.so.0

transferring in the other direction works OK.

can anybody give me a hint?

thanks
Pit
Vadim Zeitlin
2013-11-05 00:32:08 UTC
Permalink
Post by Peter Johann Brunner
I have wxGtk2 on 2 computers laptop and PC.
both AMD 64Bit Athlon / Turion X2
both Suse Linux 12.1 and wx-gtk2u-2.8.12-6.1.2-x86_64 from openSUSE
gcc is also the same 4.6.2_20111026-1.1.4-x86_64 from openSUSE
on the PC I get warnings when passing wxString_var.c_str() as parameter
printf("%s", wxString_var.c_str());
It would have helped a lot to know what did the warning actually say, but
combining this piece of information ...
Post by Peter Johann Brunner
wxString wxString_var = "sometext";
wxString wxString_var = _T("sometext");
... with that one I'd say that you're using wxWidgets 2.8 in Unicode build
on your PC but ANSI build on your laptop.
Post by Peter Johann Brunner
I think there must be some different configuration of wx on the 2 computers.
But I can find nothing: e.g. wx-config's are identical.
The wx/setup.h files used are different though.
Post by Peter Johann Brunner
cannot open shared obj file libwx_gtk2_richtext-2.8.so.0
transferring in the other direction works OK.
The only explanation for this is that you also built wxWidgets as static
library on the PC because otherwise it simply can't work without all the
shared libraries it depends on.
Post by Peter Johann Brunner
can anybody give me a hint?
Either reconfigure and rebuild with --enable-unicode or just use wxWidgets
3.0 (which is currently at RC2 step but will be released in less than a
week) where there is no difference between ANSI and Unicode build any more.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Peter Johann Brunner
2013-11-05 15:14:17 UTC
Permalink
thank you for your prompt answer.

as i wrote, the installations of wx... are identcal, not self built,
from OPenSuse, same lib-names in /usr/lib64/:
wx-2.8-stl/libwx_baseu-2.8.so
...
wx-2.8-stl/libwx_gtk2u_core-2.8.so
...
wx-2.8-wxcontainer/libwx_gtk2u_html-2.8.so
etc.
seems to be a unicode build?!

i can't say exact things about the PC at the moment as i am not at home.

on the laptop there a unicode version since starting the program with
ddd shows up a message that UTF-8 is switched off since ddd has problems
with it.

BUT:
on both computers i tried a self built version with gtk1 !
i am rather sure to have these versions deinstalled before installing
the SUSE version, but perhaps there is some rest of this installations
on one or the other computer?

I tried this versions with gtk1.2, because i dislike the newer
implementation of wxBitmapButton, and thought this could evtl. help.
but it didn't.

please see the question
wxBitmapButton with halo from cursor
in this group

thanks very much
Pit
Post by Vadim Zeitlin
Post by Peter Johann Brunner
I have wxGtk2 on 2 computers laptop and PC.
both AMD 64Bit Athlon / Turion X2
both Suse Linux 12.1 and wx-gtk2u-2.8.12-6.1.2-x86_64 from openSUSE
gcc is also the same 4.6.2_20111026-1.1.4-x86_64 from openSUSE
on the PC I get warnings when passing wxString_var.c_str() as parameter
printf("%s", wxString_var.c_str());
It would have helped a lot to know what did the warning actually say, but
combining this piece of information ...
Post by Peter Johann Brunner
wxString wxString_var = "sometext";
wxString wxString_var = _T("sometext");
... with that one I'd say that you're using wxWidgets 2.8 in Unicode build
on your PC but ANSI build on your laptop.
Post by Peter Johann Brunner
I think there must be some different configuration of wx on the 2 computers.
But I can find nothing: e.g. wx-config's are identical.
The wx/setup.h files used are different though.
Post by Peter Johann Brunner
cannot open shared obj file libwx_gtk2_richtext-2.8.so.0
transferring in the other direction works OK.
The only explanation for this is that you also built wxWidgets as static
library on the PC because otherwise it simply can't work without all the
shared libraries it depends on.
Post by Peter Johann Brunner
can anybody give me a hint?
Either reconfigure and rebuild with --enable-unicode or just use wxWidgets
3.0 (which is currently at RC2 step but will be released in less than a
week) where there is no difference between ANSI and Unicode build any more.
Regards,
VZ
Vadim Zeitlin
2013-11-12 21:59:09 UTC
Permalink
Post by Peter Johann Brunner
thank you for your prompt answer.
as i wrote, the installations of wx... are identcal, not self built,
wx-2.8-stl/libwx_baseu-2.8.so
...
wx-2.8-stl/libwx_gtk2u_core-2.8.so
...
wx-2.8-wxcontainer/libwx_gtk2u_html-2.8.so
etc.
seems to be a unicode build?!
Yes, both are built in Unicode mode.
Post by Peter Johann Brunner
on both computers i tried a self built version with gtk1 !
Well, don't. This version is not supported any more, so you are really
just looking for problems if you use it.

But in any case, this doesn't explain the differences you described in
your initial post, GTK1 or not ANSI vs Unicode remains the same.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Loading...