Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wcsdup() not defined 1

Status
Not open for further replies.

JediDan

Programmer
May 15, 2002
128
0
0
US
Hello all,

I'm working with wide characters and need to use the wcsdup function to replace some code that was using normal characters and the strdup function.

I'm including <wchar.h> and have had no problems with the wchar_t type itself nor with wcscpy, but when I try to compile when using wcsdup, I get: 'wcsdup' undeclared.

If I look inside wchar.h, I can see wcsdup declared as an extern function.

I realize the solution to this problem may be platform, compiler dependent, but I would appreciate any help at all.
I'm running on Red Hat Enterprise with gcc 2.96 (yes, it's old, and out of my control).

Thanks,

Dan
 
Is the wcsdup declaration #ifdefed out? With what?

I'll bet you need to do:

Code:
#define _GNU_SOURCE
#include <wchar.h>

to make the declaration visible to your code.
 
It was __USE_GNU, but you got me in the right direction. Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top