delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/16/22:53:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 16 Oct 2002 20:53:13 -0600
From: Eric Blake <ebb9 AT email DOT byu DOT edu>
Subject: Linker errors with gcc3.2-1 and cygwin1.13-2
To: cygwin AT cygwin DOT com
Message-id: <3DAE2619.7080807@email.byu.edu>
MIME-version: 1.0
X-Accept-Language: en-us, en
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823
Netscape/7.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019