stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Petrie, P.Eng." <apet...@attglobal.net>
Subject Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)
Date Thu, 04 Dec 2008 22:12:14 GMT
Hi Farid:

[FZ]
  It's ok. The rwstderr.cat catalog file is used for overriding standard
exceptions
what() messages (i.e. to have localized messages). On MinGW (as well as on
entire Windows) stdcxx doesn't using rwstderr.cat, but using rwstderr.dll
instead.
Actually if you're fine with english messages, you don't need
rwstderr.{cat|dll}
because of the english messages are hardcoded in library sources.

[SP]
Thanks to your previous assistance, I did succeed in using the GNUmakefile
under MinGW+MSYS, to build a stdcxx libnary libstd11s.a.

HOWEVER, I've been trying without success, to compile a minimal C++ program
under MinGW+MSYS, using the Apache C++ Standard Library (stdcxx), instead of
the Standard Library that is shipped with MinGW+MSYS.

* * *
* * *

The MinGW_MSYS environment, will compile, link and run the following test
program, using the Standard Library shipped with MinGW_MSYS:

   // test_mingw.cpp ...

   // standard library includes...
        #include <iostream>
   // ...standard library includes.

       using std::cout;

   int main (void)
   {
       cout << "Hello from test_mingw.cpp!\n";

       return 0;
   }
   // ... test_mingw.cpp.

I use the following MSYS console shell commands to compile and link the
test_mingw.cpp program:

   g++  -c  -o test_mingw.o  test_mingw.cpp  # compiles ok.
   g++  -o test_mingw test_mingw.o               # links ok.

The test_mingw.exe program produce by ld, runs fine and displays the
following on the MSYS console:

   Hello from test_mingw.cpp!.

* * *
* * *

HOWEVER, so far I have not found a way to compile a similar minimal C++
program under MinGW+MSYS, using the Apache C++ Standard Library (stdcxx),
instead of the Standard Library that is shipped with MinGW+MSYS.

The minimal C++ program I'm trying to compile is:

  // test_stdcxx_1.cpp ...

   // standard library includes...
        #include <iostream>
   // ...standard library includes.

       using std::cout;

   int main (void)
   {
       cout << "Hello from test_stdcxx_1.cpp!\n";

       return 0;
   }
   // ... test_stdcxx_1.cpp.

I use the following MSYS console shell command, to compile the
test_stdcxx_1.cpp program:

  g++.exe -I./include -nostdinc++ -nostdinc -nostdlib -c -o test_stdcxx_1.o
test_stdcxx_1.cpp

(Note the dot "." between "-I" and "/include". I have an stdcxx "include"
directory, with all its sub-directories, as a sub-directory of the directory
where the test_stdcxx_1.cpp source program is located, because I haven't yet
been able to figure out how to get g++.exe to respect a "-I" parameter
pointing to a more complex path description. The "include" directory, with
all its sub-directories, is a copy of what is shipped with stdcxx-4.2.2.)

 g++.exe displays the following compile errors on the MSYS console:

   In file included from ./include/rw/_traits.h:40,
                    from ./include/rw/_strref.h:48,
                    from ./include/string:43,
                    from ./include/loc/_locale.h:36,
                    from ./include/rw/_iosbase.h:36,
                    from ./include/streambuf:39,
                    from ./include/ostream:39,
                    from ./include/istream:38,
                    from ./include/iostream:33,
                    from test_stdcxx_1.cpp:4:
   ./include/rw/_mbstate.h:195:27: cwchar: No such file or directory
   In file included from ./include/rw/_strref.h:48,
                    from ./include/string:43,
                    from ./include/loc/_locale.h:36,
                    from ./include/rw/_iosbase.h:36,
                    from ./include/streambuf:39,
                    from ./include/ostream:39,
                    from ./include/istream:38,
                    from ./include/iostream:33,
                    from test_stdcxx_1.cpp:4::
   ./include/rw/_traits.h:104:51: cstring: No such file or directory
   In file included from ./include/rw/_strref.h:48,
                    from ./include/string:43,
                    from ./include/loc/_locale.h:36,
                    from ./include/rw/_iosbase.h:36,
                    from ./include/streambuf:39,
                    from ./include/ostream:39,
                    from ./include/istream:38,
                    from ./include/iostream:33,
                    from test_stdcxx_1.cpp:4:
   ./include/rw/_traits.h:302: error: expected `;' before "state_type"
   ./include/rw/_traits.h:303: error: `state_type' was not declared in this
scope
   ./include/rw/_traits.h:303: error: template argument 1 is invalid
   ./include/rw/_traits.h: In static member function `static _CharT*
std::char_traits<_CharT>::move(_CharT*, const _CharT*, unsigned int)':
   ./include/rw/_traits.h:347: error: `memmove' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static _CharT*
std::char_traits<_CharT>::copy(_CharT*, const _CharT*, unsigned int)':
   ./include/rw/_traits.h:353: error: `memcpy' is not a member of `std'
   ./include/rw/_traits.h: At global scope:
   ./include/rw/_traits.h:396: error: expected `;' before "state_type"
   ./include/rw/_traits.h:397: error: `state_type' was not declared in this
scope
   ./include/rw/_traits.h:397: error: template argument 1 is invalid
   ./include/rw/_traits.h: In static member function `static int
std::char_traits<char>::compare(const char*, const char*, unsigned int)':
   ./include/rw/_traits.h:420: error: `memcmp' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static const char*
std::char_traits<char>::find(const char*, unsigned int, const char&)':
   ./include/rw/_traits.h:428: error: `memchr' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static unsigned int
std::char_traits<char>::length(const char*)':
   ./include/rw/_traits.h:434: error: `strlen' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static char*
std::char_traits<char>::move(char*, const char*, unsigned int)':
   ./include/rw/_traits.h:439: error: `memmove' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static char*
std::char_traits<char>::copy(char*, const char*, unsigned int)':
   ./include/rw/_traits.h:445: error: `memcpy' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static char*
std::char_traits<char>::assign(char*, unsigned int, char)':
   ./include/rw/_traits.h:451: error: `memset' is not a member of `std'
   ./include/rw/_traits.h: At global scope:
   ./include/rw/_traits.h:483: error: expected `;' before "state_type"
   ./include/rw/_traits.h:484: error: `state_type' was not declared in this
scope
   ./include/rw/_traits.h:484: error: template argument 1 is invalid
   ./include/rw/_traits.h: In static member function `static int
std::char_traits<wchar_t>::compare(const wchar_t*, const wchar_t*, unsigned
int)':
   ./include/rw/_traits.h:504: error: `wmemcmp' was not declared in this
scope
   ./include/rw/_traits.h: In static member function `static unsigned int
std::char_traits<wchar_t>::length(const wchar_t*)':
   ./include/rw/_traits.h:509: error: `wcslen' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static const wchar_t*
std::char_traits<wchar_t>::find(const wchar_t*, unsigned int, const
wchar_t&)':
   ./include/rw/_traits.h:515: error: `wmemchr' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits<wchar_t>::copy(wchar_t*, const wchar_t*, unsigned int)':
   ./include/rw/_traits.h:522: error: `wmemcpy' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits<wchar_t>::move(wchar_t*, const wchar_t*, unsigned int)':
   ./include/rw/_traits.h:528: error: `wmemmove' is not a member of `std'
   ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits<wchar_t>::assign(wchar_t*, unsigned int, wchar_t)':
   ./include/rw/_traits.h:534: error: `wmemset' is not a member of `std'
   In file included from ./include/rw/_iosbase.h:36,
                    from ./include/streambuf:39,
                    from ./include/ostream:39,
                    from ./include/istream:38,
                    from ./include/iostream:33,
                    from test_stdcxx_1.cpp:4:
   ./include/loc/_locale.h: At global scope:
   ./include/loc/_locale.h:403: error: `mbstate_t' is not a member of `std'
   ./include/loc/_locale.h:403: error: `mbstate_t' is not a member of `std'
   ./include/loc/_locale.h:403: error: template argument 3 is invalid
   ./include/loc/_locale.h:470: error: `mbstate_t' is not a member of `std'
   ./include/loc/_locale.h:470: error: `mbstate_t' is not a member of `std'
   ./include/loc/_locale.h:470: error: template argument 3 is invalid
I've tried using a "-Z" parameter with the g++.exe command, but g++.exe
still won't generate an object file.

The first file "cwchar" that g++.exe is complaining that it can't find, does
exist. It's in directory ./include/ansi/ I tried copying file "cwchar" to
./include/ but this didn't fix the first compiler error.

* * *
* * *
.
Any suggestions you could make, would be most appreciated. Or, if you could
compile and link my minimal test program "test_stdcxx_1.cpp" under your
MinGW+MSYS, and tell me how you did it, that would be even better.

Thanks.

Steve

----- Original Message ----- 
From: "Farid Zaripov" <Farid_Zaripov@epam.com>
To: <user@stdcxx.apache.org>
Sent: Wednesday, December 03, 2008 3:51 AM
Subject: Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)


> HOWEVER, after the completion of the "ar rv   libstd11s.a ..." command
> executed near the very end of the build process, the following was
> displayed
> on the MSYS console, and the build process stopped:

[...]
>   i:\apps\mingw\bin\ar.exe: creating libstd11s.a
>   gencat rwstderr.cat /stdcxx-4.2.2/src/rwstderr.msg
>   /bin/sh: gencat: command not found
>   make[2]: [rwstderr.cat] Error 127 (ignored)

  It's ok. The rwstderr.cat catalog file is used for overriding standard
exceptions
what() messages (i.e. to have localized messages). On MinGW (as well as on
entire Windows) stdcxx doesn't using rwstderr.cat, but using rwstderr.dll
instead.
Actually if you're fine with english messages, you don't need
rwstderr.{cat|dll}
because of the english messages are hardcoded in library sources.

> Would please tell me, what do I need to do, to get the gencat.exe utility
> to
> accept the rwstderr.msg file?

  On Windows gencat.exe acceps rwstderr.rc file and produces rwstderr.dll
file.

Farid.


Mime
View raw message