entry point strncpy_s could not be located

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

entry point strncpy_s could not be located

Kyle Schwarz
I'm getting the following error while trying to run FFmpeg with Windows
XP using the latest version of pthreads-win32: "The procedure entry
point strncpy_s could not be located in the dynamic link library msvcrt.dll"

Here is a little more information about the bug:
> This is because of a change in the pthreads-w32 CVS. I encountered it after I updated to GCC 4.8.1 but didn't realize anything was wrong until I'd gotten x264 and FFmpeg built. Thankfully, none of the aggregate libraries seem to be affected by pthreads doing this, so it seems relatively benign. The binaries as distributed will work fine on Vista and higher since the version of msvcrt.dll has the secure API functions necessary. If WinXP is a target, pthreads needs a little patching.

That was posted by the user qyot27 at:
<http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=1291>

There is also a patch that he submitted that seems to fix the issue:
> # For Windows XP users only:
> sed -i 's/ -DMINGW_HAS_SECURE_API//' GNUmakefile
>
>      sed -i -e '60i#ifdef MINGW_HAS_SECURE_API' \
>      -e '61i#else\n  strncpy(name, tp->name, len - 1);\n#endif' pthread_getname_np.c
>
>      sed -i -e '46i#ifdef MINGW_HAS_SECURE_API' \
>      -e '47i#else\n  strncpy(name, tp->name, len - 1);\n#endif' pthread_attr_getname_np.c

I would really apprciate any help on this, currently my FFmpeg builds
are useless to Windows XP users because I utilize pthread-w32.

Best regards,
   Kyle
Reply | Threaded
Open this post in threaded view
|

Re: entry point strncpy_s could not be located

Ross Johnson-2
I've taken the other route and substituted strncpy() in place of
strncpy_s() and ignored any compiler warnings. A null byte is explicitly
added to ensure we comply with the [Linux] man page description that the
returned string shall be null terminated (for the case where strncpy
doesn't add one).

This change has been committed to both the SourceForge Pthreads4w Git
and sourceware.org Pthreads-win32 CVS repositories.

Apologies for not researching the original additions thoroughly.

On 17/07/2013 9:03 AM, Kyle Schwarz wrote:

> I'm getting the following error while trying to run FFmpeg with
> Windows XP using the latest version of pthreads-win32: "The procedure
> entry point strncpy_s could not be located in the dynamic link library
> msvcrt.dll"
>
> Here is a little more information about the bug:
>> This is because of a change in the pthreads-w32 CVS. I encountered it
>> after I updated to GCC 4.8.1 but didn't realize anything was wrong
>> until I'd gotten x264 and FFmpeg built. Thankfully, none of the
>> aggregate libraries seem to be affected by pthreads doing this, so it
>> seems relatively benign. The binaries as distributed will work fine
>> on Vista and higher since the version of msvcrt.dll has the secure
>> API functions necessary. If WinXP is a target, pthreads needs a
>> little patching.
>
> That was posted by the user qyot27 at:
> <http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=1291>
>
> There is also a patch that he submitted that seems to fix the issue:
>> # For Windows XP users only:
>> sed -i 's/ -DMINGW_HAS_SECURE_API//' GNUmakefile
>>
>>      sed -i -e '60i#ifdef MINGW_HAS_SECURE_API' \
>>      -e '61i#else\n  strncpy(name, tp->name, len - 1);\n#endif'
>> pthread_getname_np.c
>>
>>      sed -i -e '46i#ifdef MINGW_HAS_SECURE_API' \
>>      -e '47i#else\n  strncpy(name, tp->name, len - 1);\n#endif'
>> pthread_attr_getname_np.c
>
> I would really apprciate any help on this, currently my FFmpeg builds
> are useless to Windows XP users because I utilize pthread-w32.
>
> Best regards,
>   Kyle