0

today I have been trying to get standard functions to work in my application such as sprintf, ect.

When ever using functions like sprintf, fgets or anything else standard my application crashes with runtime error - CRT not initialized

Current linker options:

/ignore:4098 /dll /entry:"_DllMainCRTStartup" /include:"XboxKrnlBuildNumber" /ALIGN:128,4096 

Entry point:

BOOL APIENTRY DllMain(HANDLE hInstDLL, DWORD reason, LPVOID lpReserved)

Tried to init it my self by defining _CRT_INIT is an extern that takes no arguments and calling it in my DLL_PROCESS_ATTACH with no luck.

I've been stuck on this issue for months but just thought i'd come back to it and look a little deeper.

Konroi
  • 5
  • 6
  • What language/compiler/platform are you using? – Eric Jan 31 '14 at 00:06
  • /entry:"_DllMainCRTStartup" is correct. If you need to use that option explicitly to get it to link then there's something seriously wrong. So omit it and tell us what goes wrong then. – Hans Passant Jan 31 '14 at 00:38

1 Answers1

0

If you are doing something non-trivial in your DllMain function, this may be of help:

http://blog.barthe.ph/2009/07/30/no-stdlib-in-dllmai/

http://blogs.msdn.com/b/larryosterman/archive/2006/06/15/632502.aspx

Max
  • 170
  • 1
  • 10