Discussion:
wxWidgets unicode trouble
Matej Tyc
2007-09-15 19:29:29 UTC
Permalink
Hello,
I have big problems concerning building astade since nowadays it is very
hard to find a wxWidgets non-unicode build :-)
The code is written badly, if you include strings in _("<string>") <--
this construct, there will be no problems whatsover.
I would like to fix it, can you give me some sort of starting point? I
see that astade doesn't use autotools (why?), and since I am not a real
expert I don't know how to manage the source efficently.
Can you help me somehow?
Matej
Anders Larsen
2007-09-16 20:32:32 UTC
Permalink
Hi,
Post by Matej Tyc
I have big problems concerning building astade since nowadays it is very
hard to find a wxWidgets non-unicode build :-)
As you have probably guessed, Astade was originally written against an
ANSI build of wxWidgets.
This was not a problem in the past, since Astade uses english (7-bit)
texts throughout.

However, since the wxWidgets developers are going to make unicode be the
default, we're have no choice but to make Astade unicode-friendly.

Astade already builds and runs perfectly fine on Linux when built against
a unicode-build of the current (development) version of wxWidgets; but I
haven't tested it on Windows/unicode.
Post by Matej Tyc
The code is written badly, if you include strings in _("<string>") <--
this construct, there will be no problems whatsover.
Well, the macro _() is intended for internationalisation (see the docs for
wxGetTranslation); you probably meant _T() or wxT() which tells the
compiler to encode literal text as wchar_t[]

At any rate, as you have noted, Astade is full of texts that are not (yet)
marked with _T() - I only fixed the ones that prevented the Linux version
from being built.
Post by Matej Tyc
I would like to fix it, can you give me some sort of starting point?
It sounds a bit like a chicken-and-egg problem; you'd probably need to
install an ANSI version of wxWidgets first and build Astade against it
in order to fix Astade to work with a unicode-wxWidgets.

That said, we really appreciate any help we can get!
Post by Matej Tyc
I see that astade doesn't use autotools (why?),
GNU autotools suck (see http://freshmeat.net/articles/view/889/)
They may be able to help you build a program on several different unixes,
but they aren't at all helpful when you want to build the program on a
non-unix platform (e.g. Windows). Apart from that, they are not
particularly developer-friendly (lack of backwards compatibility
immediately comes to mind - I have 4 (four) different versions of GNU
automake installed in order to build a few applications from source)

Thanks to the cross-platform nature of the wxWidgets toolkit our Makefiles
look almost identical on Linux, Windows and MAC OS-X (and they are pretty
clean, too); no need to fiddle with autotools.
Post by Matej Tyc
and since I am not a real
expert I don't know how to manage the source efficently. Can you help me
somehow?
The source of the Astade suite is managed by the Astade tree-viewer itself.

The first thing to do is to get a working Astade installation on your
platform - which OS are you using, which wxWidgets version etc.?

Cheers
Anders
Matej Tyc
2007-09-18 01:37:00 UTC
Permalink
Post by Anders Larsen
Hi,
Post by Matej Tyc
I have big problems concerning building astade since nowadays it is very
hard to find a wxWidgets non-unicode build :-)
As you have probably guessed, Astade was originally written against an
ANSI build of wxWidgets.
This was not a problem in the past, since Astade uses english (7-bit)
texts throughout.
However, since the wxWidgets developers are going to make unicode be the
default, we're have no choice but to make Astade unicode-friendly.
Astade already builds and runs perfectly fine on Linux when built against
a unicode-build of the current (development) version of wxWidgets; but I
haven't tested it on Windows/unicode.
Unfortunatelly, it doesn't build against stable Linux unicode wxWidgets
2.8 that most distributions will be using for a long time...
Post by Anders Larsen
Post by Matej Tyc
The code is written badly, if you include strings in _("<string>") <--
this construct, there will be no problems whatsover.
Well, the macro _() is intended for internationalisation (see the docs for
wxGetTranslation); you probably meant _T() or wxT() which tells the
compiler to encode literal text as wchar_t[]
At any rate, as you have noted, Astade is full of texts that are not (yet)
marked with _T() - I only fixed the ones that prevented the Linux version
from being built.
You're absolutely right about that.
Post by Anders Larsen
Post by Matej Tyc
I would like to fix it, can you give me some sort of starting point?
It sounds a bit like a chicken-and-egg problem; you'd probably need to
install an ANSI version of wxWidgets first and build Astade against it
in order to fix Astade to work with a unicode-wxWidgets.
That said, we really appreciate any help we can get!
Post by Matej Tyc
I see that astade doesn't use autotools (why?),
GNU autotools suck (see http://freshmeat.net/articles/view/889/)
They may be able to help you build a program on several different unixes,
but they aren't at all helpful when you want to build the program on a
non-unix platform (e.g. Windows). Apart from that, they are not
particularly developer-friendly (lack of backwards compatibility
immediately comes to mind - I have 4 (four) different versions of GNU
automake installed in order to build a few applications from source)
Thanks to the cross-platform nature of the wxWidgets toolkit our Makefiles
look almost identical on Linux, Windows and MAC OS-X (and they are pretty
clean, too); no need to fiddle with autotools.
Linux users would probably benefit from autotools usage, but it seems to
me that you know what you are doing :-)
Post by Anders Larsen
Post by Matej Tyc
and since I am not a real
expert I don't know how to manage the source efficently. Can you help me
somehow?
The source of the Astade suite is managed by the Astade tree-viewer itself.
The first thing to do is to get a working Astade installation on your
platform - which OS are you using, which wxWidgets version etc.?
I am running Arch Linux, wx-config --list output is
gtk2-unicode-release-2.8; when I altered makefiles (build was impossible
since wx-config --cxxflags etc. --unicode=no produced a nonsense),
compiler threw a lot of familiar errors originating from absence of _T
macro.

Thank you for your reply, I thought of some solution involving post
processing of compiler error messages. Since the fix for this issue is
just some string substitution, it would be a shame to do it
manually :-)
Regards,
Matej
Post by Anders Larsen
Cheers
Anders
---------------------------------------------------------------------
Jonatan Antoni
2007-09-17 16:05:12 UTC
Permalink
Hello Matej,
Post by Matej Tyc
I am running Arch Linux, wx-config --list output is
gtk2-unicode-release-2.8; when I altered makefiles (build was impossible
since wx-config --cxxflags etc. --unicode=no produced a nonsense),
compiler threw a lot of familiar errors originating from absence of _T
macro.
Have you tried to install a wxwidgets ansi version and build astade
against that? Just setting wx-config --unicode=no without having a
fitting wxWidgets installed will break with an error. It is no problem
to have various wxWidgets builds in parallel installed. The wx-config
script manages to include and link the one library party you need.

I am currently building fresh wxwidgets from sources, because my gentoo
linux has no wx-2.8 in portage, yet. It seems a little tricky, because I
want to have the wxPython-bindings as well.

I will let you know as soon as I have a working wx-2.8 here, whether I
can build Astade with unicode wx or only with ansi wx.


Greetings,
Jonatan
Jonatan Antoni
2007-09-19 18:03:34 UTC
Permalink
Hello Matej,

I've successfully compiled fresh wxwidgets 2.8.4.0. I've installed both
ansi and unicode build. Astade compiles only agains the ansi-library. As
far as I can see, there are only some "wxT" missing for a clean unicode
build. I don't know why the wx developers want that...

Do you want to correct that? Your help is welcome.

To start developing Astade you have to build Astade against an ansi wx
for the first time. Later you can switch.

Greetings,
Jonatan

Loading...