Boost logo

Boost-Build :

Subject: Re: [Boost-build] Help! Building regex with win32 and gcc
From: Brian Ravnsgaard Riis (brian_at_[hidden])
Date: 2009-04-10 09:06:06


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

¶­†´ wrote:
> Hello everyone. I'm a amateur programmer and I want to use regular
> expression utility in my program.
> However I met several problems that I can't figure them out.
>
> I'm using a x86 computer with WindowsXP and Dev-c++ 4.9.9.2 IDE.
> At first I build a "a" file using command "make -fgcc.mak" and linked it
> from my program.
> It works well.
>
> After that, I still need the "wregex" class to handle some wide
> characters. However, the compiler
> prompted me that "wregex is not a member of boost".

Well, it is... but just not with gcc on windows. The problem is the
standard library port on MinGW (the compiler underneath Dev-C++): it
doesn't support wide strings at all, and since wregex requires wstring
you're out of luck.

This is a standard library issue, so if you replace MinGW's standard
library with one that does support wide strings matters will improve.
Try STLPort at http://www.stlport.org/

>
> So, I read the config.hpp in regex directory and inserted "#define
> BOOST_HAVE_OTHER_WCHAR_T"
> since Dev_c++ does provide a native wchar_t type. But that makes no
> difference.

No, because MinGW (and thus Dev-C++) does not support wstring even
though it supports wchar_t.

>
> Than I manually undefined the "BOOST_NO_WREGEX" in the header. This
> change makes compiler
> no longer returning "no such member", but the linker failed.
> The linker returned:
> [Linker error] undefined reference to `boost::basic_regex<wchar_t,
> boost::regex_traits<wchar_t, boo
> st::cpp_regex_traits<wchar_t> > >::do_assign(wchar_t const*, wchar_t
> const*, unsigned int)'
>
> According to documents, it is said that the lib file won't support
> Unicode if I do not provide path of
> "ICU" to the make file. However, I have no idea of what ICU is and I
> don't think I really need some kind
> of "ICU" since I want wregex instead of u32regex.

International Components for Unicode. http://icu-project.org/
It won't enable wstring support, though.

>
> So, could anyone help me with this issue to enable me
> using :"wregex"
> on: Win32 + dev-cpp IDE platform
> to handle: string of native type "wchar_t" (which is a short int)

Again, you need a different standard library to support this. This
requires its own setup, but will open the "wide" world to you once you
get it running. Try STLPort. It's great, it supports a debugging STL
(which is *really* great), and it's free. http://www.stlport.org/

Good luck.

 /Brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ30Q+k1tAOprY6QERAoKgAJ9SBtzeei6dqVn0S9ZXGg9MnUloGgCff4up
+DSpLU+FBXJkcGIsB+aVkrw=
=TIzx
-----END PGP SIGNATURE-----


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk