mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] conflicting definition of wcstok(...)


From: Alois Schlögl
Subject: [Mingw-cross-env-list] conflicting definition of wcstok(...)
Date: Mon, 14 Jan 2013 11:36:50 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20121215 Iceowl/1.0b1 Icedove/3.0.11

There seem to be conflicting definitions of wcstok around:

MXE provides in string.h
  _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*);

http://msdn.microsoft.com/en-us/library/2c8d19sb%28v=vs.71%29.aspx
wchar_t *wcstok(
   wchar_t *strToken,
   const wchar_t *strDelimit
);

My application requires wcstok as defined here:
   http://pubs.opengroup.org/onlinepubs/009604599/functions/wcstok.html

wchar_t *wcstok(wchar_t *restrict ws1, const wchar_t *restrict ws2,
       wchar_t **restrict ptr);


and I get this error message:
/scratch/schloegl/src/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.2/../../../../i686-pc-mingw32/include/string.h:141:42:
note: declared here
./Modules/getpath.c:302:25: error: too many arguments to function 'wcstok'



I want to use definition of the opengroup, with the state as third input
argument.
At
   http://stackoverflow.com/questions/4327220/x-platform-reentrant-wcstok
it was recommended to use wcstok_s instead of wcstok.
But this results in the linker error: "undefined reference to `wcstok_s'".


Has anyone else found a solution to that problem ? Is there a
recommended way how to deal with this ?


   Alois




reply via email to

[Prev in Thread] Current Thread [Next in Thread]