5

I know this question has popped up before but I could not find a good answer so I try here.

I have a pure C dll (Win32) and I get this warning when compiling:

MSVCRTD.lib(cpu_disp.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators

Everything seems to work just fine but I am concerned about this warning since I do not understad it. I have quite a few static variables but I do not understand what ".CRT section exist" means.

What approach should I take to eliminate this warning. When I try to add the libs msdn suggests I get a ton of linker errors.

rene
  • 41,474
  • 78
  • 114
  • 152
Johan
  • 51
  • 1
  • 2
  • 3
    Don't ignore this warning, the CRT needs to be initialized properly with a "static initializer". Document your linker options. – Hans Passant Jan 18 '10 at 14:40

2 Answers2

3

I too had this problem; as noted when the question was asked here, the problem was the /ENTRY:"main" which gave this error; removing that argument fixes the warning.

benpmorgan
  • 604
  • 3
  • 9
0

I solved this error by removing the /NOENTRY linker option.

liorda
  • 1,552
  • 2
  • 15
  • 38