Mail Archives: cygwin/2002/10/16/22:53:33
I had been using the experimental gcc 3.2-1, but now that it is no
longer experimental, I deleted and reinstalled it at the same time I
upgraded to cygwin 1.13-2. I also made sure I have mingw-runtime 2.2-1.
Now I am having problems with g++ and things like wcslen. Does anyone
see this, or know what the solution might be?
I'm on a Win98 box. I also verified that this sequence of commands
works for a Linux version of g++ 3.2, and that the C compiler gcc does
not have this problem. It is only g++ that is having problems with
<wchar.h> or <cwchar>.
$ cat Blah.cc
#include <wchar.h>
#include <stdio.h>
int main(int argc, char**argv)
{
printf("wcslen: %d\n", wcslen(L"abcd"));
return 0;
}
$ gcc -x c -o Blah Blah.cc
$ g++ -o Blah Blah.cc
/cygdrive/c/windows/temp/ccDjTSsl.o(.text+0x3c):Blah.cc: undefined
reference to `wcslen(wchar_t const*)'
collect2: ld returned 1 exit status
$ cat Blah1.cc
#include <cwchar>
#include <stdio.h>
int main(int argc, char**argv)
{
printf("wcslen: %d\n", wcslen(L"abcd"));
return 0;
}
$ g++ -o Blah Blah1.cc
Blah1.cc: In function `int main(int, char**)':
Blah1.cc:6: `wcslen' undeclared (first use this function)
Blah1.cc:6: (Each undeclared identifier is reported only once for each
function it appears in.)
$ cat Blah2.cc
#include <wchar.h>
#include <cwchar>
#include <stdio.h>
int main(int argc, char**argv)
{
printf("wcslen: %d\n", wcslen(L"abcd"));
return 0;
}
$ g++ -o Blah Blah2.cc
In file included from Blah2.cc:2:
/usr/include/c++/3.2/cwchar:65: conflicting types for `typedef struct
mbstate_t
mbstate_t'
/usr/include/wchar.h:36: previous declaration as `typedef struct _mbstate_t
mbstate_t'
--
This signature intentionally left boring.
Eric Blake ebb9 AT email DOT byu DOT edu
BYU student, free software programmer
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -