On Thu, Mar 10, 2011 at 09:07, Dock, Dion <dion_dock@mentor.com> wrote:
How did you do that?  nm isn't displaying those functions in my preferred runtime lib, libmsvcr80.a.  For example,
  C:\Temp>C:\mingw_32\bin\i686-w64-mingw32-nm.exe C:\mingw_32\mingw\lib\libmsvcr80.a | find "strcpy_s"

You can use gendef [1, 2] to generate .def file from .dll file.

[1] https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/trunk/mingw-w64-tools/gendef
[2] http://i18n-zh.googlecode.com/files/gendef-r3706.exe


Thanks!  Adding the "-lmsvcr80" resolved a few of the symbols.  Now I've hit the next stumbling block: vsnprintf_s and localtime32_s.

These don't seem to be in libmsvcr80.a, but per the above, I'm not sure how to check for their presence.  Neither is a macro, however.

In  msvcr80.dll, here is thess function names list:


So you must use vsnprintf_s and localtime32_s with prefix '_', as ms vc declared:
_CRTIMP errno_t __cdecl _localtime32_s(_Out_ struct tm *_Tm, _In_ const __time32_t * _Time);
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl _vsnprintf_s(_Out_z_cap_(_SizeInBytes) char * _DstBuf, _In_ size_t _SizeInBytes, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, va_list _ArgList);

But in the w64 repository, no such symbols:

$ grep -E "vsnprintf|localtime" msvcr80.def
localtime DATA
;_localtime32 = localtime

So you must add these symbols yourself, then rebuild libmsvcr80.a; or you can simply copy msvcr80.dll to libmsvcr80.a.

@Kai, could you rebuild msvcr*.def from msvcr*.dll ?