link troubles with wcslen

Shankar Unni shankar@cotagesoft.com
Mon Oct 28 12:42:00 GMT 2002


On 10/27/2002 5:07 PM, Xavier Pianet wrote:
> I can only manage to get errors :
> /c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccDaW1wr.o(.text+0x38):Blah.cc: 
> undefined reference to `wcslen(wchar_t const*)'

This looks like the "wcslen" declaration isn't being protected by an 
'extern "C"' block.

I notice that you're compiling "Blah.cc" with "gcc" instead of "g++". In 
1.3.12 (I'm still on this, which uses gcc 2.95.3), this seems to work: I 
can compile the sample program with "gcc wcslen.cc", and it uses C++ 
compilation rules throughout to compile.

What the above error seems to suggest is that the "gcc foo.cc" seems to 
*preprocess* the source as if it were C (thus not expanding the 
BEGIN_DECLS and END_DECLS macros to extern "C" {, etc.), but is 
*compiling* them as C++ (generating mangled external names).

Xavier: can you do the compilation using "-v" and post the output as an 
attachment?  ("gcc -v -o Blah Blah.cc")

--
Shankar.




--
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/



More information about the Cygwin mailing list