0

I am currently trying to build pthread-win32 from here (version 2.7.0). I have the project checked out and can run and view results of NMAKE VC-static from the VS2015 developer command prompt. I have an error when building:

error C2011: 'timespec': 'struct' type redefinition

I think it is solved by adding the preprocessor directive HAVE_STRUCT_TIMESPEC (source).

In order to show correct application of the fix, I decided to silence a warning first. Specifically the warning:

warning C4996: '_ftime64': This function or variable may be unsafe. Consider using _ftime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

This one explicitly tells you to define _CRT_SECURE_NO_WARNINGS. According to MS here we should use -D or /D to define preprocessor directives on the command line. I am successfully able to silence the warning by doing:

set cl= /D_CRT_SECURE_NO_WARNINGS
nmake VC-static

But when I do the same to fix the error:

set cl=/DHAVE_STRUCT_TIMESPEC /D_CRT_SECURE_NO_WARNINGS // or just
set cl=/DHAVE_STRUCT_TIMESPEC
//and
nmake VC-static

It is not solved.

This fix is noted, both on several sources for different libs, in pthread bugfix reports, and here, how can i apply this fix in my situation?

Fantastic Mr Fox
  • 32,495
  • 27
  • 95
  • 175

0 Answers0