running a dll that uses fgets internally to read a file. I don’t want to put down the whole stack trace so I’ll just put down the relevant bits.
(0x7717F0A3) (ntdll): (filename not available): Ordinal6 + 0xd0c
(0x7717EFBF) (ntdll): (filename not available): Ordinal6 + 0xc28
(0x7717EFED) (ntdll): (filename not available): Ordinal6 + 0xc56
(0x15FE0932) f:\dd\vctools\crt_bld\self_x86\crt\src_file.c (236 + 0xa): _lock_file + 0x3e
(0x15FDF9E0) f:\dd\vctools\crt_bld\self_x86\crt\src\fgets.c (71 + 0x6): fgets + 0x5e
I’m not sure what this means other than fgets.c is causing the crash. I made sure that the correct dll that fgets.c is in was loaded as well (msvcr100d.dll) in this case.
I only have this problem in windows. Works fine in the mac bundle, android .so, and even iOS.
After doing some searching around I found that this is a common error for when the dlls are not built correctly to run together. However, mine work fine when I use them from inside visual studio. Could Unity be doing something weird?
what platform is this - Windows Standalone, Windows Store Apps?
This is just a stab in the dark on my part, and I don’t even remember the exact term used in the linker settings, but did you try compiling the DLL to use a statically linked version of the C runtime instead of the dynamically linked version?
This is on windows standalone.
I set the runtime library to multithreaded dll when I compiled.
Well, it’s hard to tell what’s wrong without a repro, but Unity doesn’t do anything with that function, your C runtime is failing for some reason. Try doing what shaderop suggested.