为什么MINGW GCC不需要-LM选项?
编译器选项-LM是需要在Linux GCC上包含Math.h中包含函数的编译和链接程序时,否则将出现链接错误。但是,在Windows上的MingW GCC中不需要-LM选项。
Compiler option -lm is required when compiling and linking program containing functions in math.h on Linux GCC, otherwise a link error will appear. However, -lm option is not required in MinGW GCC on Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MingW(-w64)不需要的
-LM
选项,因为数学功能已经是mingw(-w64)的一部分。The
-lm
option in't required with MinGW(-w64) because the math functions are already part of MinGW(-w64).