-1

I got a terrible crash in my c++ Windows application.

It always crashes (terminates itself without any prompt) at the constructor of some stl classes (e.g. string, iostream). Actually, it crashes at heap_alloc function which is prior to the constructor call.

The issue only happens with compiling and linking with /MT option. If I switch to /MD, everything works fine.

Any clue?

PS: My dev environement is Windows7 x64 + VS2010SP1, the only 3rd party library that I use is 7z (lzma86 SDK). And I'm building x86 applications...

Thanks, -Miles

Miles Chen
  • 793
  • 1
  • 10
  • 20
  • 1
    not enough information... could be anything – thang Feb 01 '13 at 04:50
  • A minimal working (or crashing, in this case) example would be helpful. – Thomas Feb 01 '13 at 06:15
  • 1
    I thought it is a common issue which has already been investigated and solved. As it could be anything, I will investigate it again and try to summarize a minimal repro steps. Thanks for the suggestion. – Miles Chen Feb 01 '13 at 13:16

1 Answers1

0

umhhh... I have found the issue.

It is due to an additional option '/ENTRY' was assigned to the project. (I just forgot it since it was a 6-years-old project). As the default _crtmain function doesn't get called, STL function fails.

Miles Chen
  • 793
  • 1
  • 10
  • 20