[x265] Build failure on MinGW GCC 4.7.1 x64, revision 288a83d

Nikos Barkas nikbar2004 at yahoo.com
Mon Mar 3 23:15:05 CET 2014


The strtok_s function is the secure api variant of strtok. For MinGW-w64, which is what I am using - on Windows 7, not Linux - using secure api functions requires some work done in advance. The following needs to be inserted at the beginning of param.cpp:

#ifdef __MINGW32__
#define MINGW_HAS_SECURE_API1
#include <sec_api/string_s.h>
#endif

The macro MINGW_HAS_SECURE_API must be defined and string_s.h must be specifically included. With the above, x265 can be compiled successfully.

Best regards
Nikos



On Monday, March 3, 2014 8:13 PM, Steve Borho <steve at borho.org> wrote:
 
On Mon, Mar 3, 2014 at 1:29 AM, Nikos Barkas <nikbar2004 at yahoo.com> wrote:

> Building tip revision 288a83d fails with this message on MinGW x64:
>
> c:/x265/source/common/param.cpp: In function 'int x265::parseCpuName(const
> char*, bool&)':
> c:/DriveD/x265Project/x265/source/common/param.cpp:738:59: error: 'strtok_s'
> was not declared in this scope
> make[2]: *** [common/CMakeFiles/common.dir/param.cpp.obj] Error 1
> make[1]: *** [common/CMakeFiles/common.dir/all] Error 2
> make: *** [all] Error 2

Odd.  My MinGW wouldn't build with strtok_r, it needed the Windows strtok_s.

Hmm, so I either need to detect this function at configure time, or
just implement it internally.

Perhaps this one: http://stackoverflow.com/questions/12975022/strtok-r-for-mingw

Just curious, but is your MinGW hosted on Linux? I'm curious why yours
does not see strtok_s.

-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140303/33c7ab78/attachment.html>


More information about the x265-devel mailing list