_HUGE and __IMP__HUGE in "math.h"

I have a question about how the constants defined in math.h are related.

In Visual Studio 2010, I create a 64-bit C ++ dll library with "MD" that uses a third-party library that uses "HUGE_VAL". From the math.h header, it seems that HUGE_VAL is defined as _HUGE. When I try to build, a communication error occurs

error LNK2001: unresolved external character _HUGE

After doing some searches, I think _HUGE should be defined in msvcrt.lib. MSVCRT.lib is bound, but I did not bundle libcmt.lib because it might cause override errors.

What seems strange to me is that when I create a simple console program that uses HUGE_VAL and uses / verbose as a linker option, it shows that _IMP_HUGE is connected.

What am I really curious about at what stage _HUGE turns into _IMP_HUGE? Also, has anyone else received an unresolved "HUGE" error, and does anyone have any ideas on how to fix this?

Thanks for reading the long question and any ideas.

+5
source share
1 answer

I ran into this problem with VC11.0. The only error I get is an unresolved _HUGE character error.

, , "libcmt.lib" , ( ).

, SDK , , : _DLL.

_HUGE __declspec (dllimport), . "math.h" β†’ "crtdefs.h" _DLL , __declspec (dllimport) 'ed .

, make , _DLL. -D_DLL - .

, , , , - .

+2

All Articles