当前位置:网站首页>_HUGE and __IMP__HUGE in “math.h“
_HUGE and __IMP__HUGE in “math.h“
2022-07-28 09:53:00 【vv1025】
I have a question about how constants defined in math.h are linked.
In visual studio 2010, I'm building a 64-bit dll c++ library with "MD" that uses a third party library that make use of "HUGE_VAL". From the header "math.h", it seems that "HUGE_VAL" is defined as "_HUGE". When I try to build, a linking error results
error LNK2001: unresolved external symbol _HUGE
After doing some googling, I think _HUGE should be defined in msvcrt.lib. MSVCRT.lib is linked, but I didn't link libcmt.lib because it would cause re-definition errors.
What strikes me as odd is that when I create a simple console program that uses HUGE_VAL and use /verbose as a linker option, it shows _IMP_HUGE being linked.
What I'm really curious of is at what stage does _HUGE turn into _IMP_HUGE? Also, have anyone else gotten the unresolved _HUGE error and does anyone have any ideas for how it could be fixed?
Thanks for reading the long question and for any ideas.I have experienced this issue with VC11.0. The only error I get is an unresolved symbol _HUGE error.
I am linking with dynamic multi-threaded run time libraries and I found that if I were to include "libcmt.lib" in my link step, then the issue is resolved (or worked around).
I started looking into how the headers were defined in the SDK for clues and found that I was missing a compiler pre-directory in my compile steps: _DLL.
When you build with dynamic run time libraries the _HUGE variable needs to be __declspec(dllimport) so it can be found. When you include "math.h" -> "crtdefs.h" without setting _DLL as a pre-directive, the variable will not be __declspec(dllimport)'ed and will appear missing at link time.
I was getting this issue because I am compiling with my own custom makefiles and I had neglected to add the _DLL pre-directive. Adding -D_DLL to my compilation step resolved the compile issue with no other changes needed.
I know this thread is old, but figured I would throw it out there as it may help someone with a similar issue.
Share
Improve this answer
Follow
answered Aug 22 '13 at 0:41LIBCD.lib
LIBC.lib
LIBCMT.lib边栏推荐
- Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
- [esp32][esp idf] esp32s3 quickly build lvglv7.9
- 房地产数字化转型方案:全方位数智化系统运营,助力房企管控实效提升
- TCP Basics
- Basic knowledge of redis
- Include and require include_ Once and require_ Once difference
- arthas使用教程
- [jzof] 15 bits of 1 in binary
- 一文读懂Plato Farm的ePLATO,以及其高溢价缘由
- Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached
猜你喜欢

工业品MRO采购网站有哪些优势?一文带你读懂
![[ESP32][esp-idf][LVGL7.9] 使用oled iic编译失败](/img/16/e5aa43df6ef9bdbc173fa547c85559.png)
[ESP32][esp-idf][LVGL7.9] 使用oled iic编译失败

Software testing and quality learning notes 2 - black box testing

Read Plato farm's eplato and the reason for its high premium
![[esp32][esp idf] esp32s3 quickly build lvglv7.9](/img/39/8efef047d0a9223b97819a54b5edf8.png)
[esp32][esp idf] esp32s3 quickly build lvglv7.9

2021.07.13 我们是这样崩的

Boss: there are too many systems in the company. Can we realize account interworking?

Illustrate three mainstream enterprise architecture models (recommended collection!)

博弈论 1.Introduction(组合游戏基本概念、对抗搜索、Bash游戏、Nim游戏)

JS promotion: the underlying principle of flat tiling
随机推荐
Pycharm uses CONDA to call the remote server
Set of bus related concepts
SkiaSharp 之 WPF 自绘 拖曳小球(案例版)
二分、三分、01分数规划 【第I弹】
房地产数字化转型方案:全方位数智化系统运营,助力房企管控实效提升
Introduction to evaluatorfilter
TCP Basics
Boss: there are too many systems in the company. Can we realize account interworking?
ThresholdFilter简介说明
The blind box of super primitive series will be launched soon, and platofarm will enable more rights and interests
Introduction to timebasedrollingpolicy
高温持续,公交企业开展安全专项培训
在Plato Farm新经济模型下,如何在游戏中获取更多MARK
刚获融资的Espresso Systems,知识产权与团队道德双双陷入困境
OSPF的拓展配置,选路原则,防环及重发布
OSPF expansion configuration, routing principles, anti ring and re release
Fixedwindowrollingpolicy introduction
j s的数组方法,循环
Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm
(10) Defer keyword