SOIL 连接不正确

SOIL not linking correctly(SOIL 连接不正确)
本文介绍了SOIL 连接不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在我的库中链接 SOIL,但是当我编译时,我收到这些链接器错误:

<前>1>LINK : 警告 LNK4098: defaultlib 'MSVCRT' 与其他库的使用冲突;使用/NODEFAULTLIB:library1>libSOIL.lib(stb_image_aug.o):错误 LNK2019:未解析的外部符号 __alloca 在函数 _stbi_zlib_decode_noheader_buffer 中引用1>libSOIL.lib(image_helper.o):错误LNK2019:函数_RGBE_to_RGBdivA2中引用的未解析的外部符号_sqrtf

我确实在附加依赖项中链接了 libSOIL.lib.

解决方案

未解决的符号错误,错误 LNK2019,来自 libgcc.lib 或其他标准库实现中的符号(参见 此处 用于 Microsoft 选项)未链接到.alloca 和 sqrtf 都是标准库函数.

如果您没有链接到标准库,则通过将其添加到您的链接器库路径来链接到一个标准库.

从上面警告 LNK4098 的警告来看,您更有可能链接到标准库,但链接器不知道要加载哪个库.

推荐链接器参数来消除这个问题(告诉链接器选择一个特定的标准库)是/NODEFAULTLIB:"MSVCRT"/NODEFAULTLIB:"LIBCMT.

有关其他信息和资源,请参阅以下链接

  • 链接器工具警告 LNK4098
  • 链接问题解决
  • Visual C++ 中的默认库
  • 解决 LNK4098:defaultlib 'MSVCRT' 与堆栈溢出问题冲突

I am linking SOIL in my library but when I compile I get these linker errors:

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libSOIL.lib(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>libSOIL.lib(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2

I did link libSOIL.lib in the addition dependencies.

解决方案

The unresolved symbol errors, error LNK2019, are from the symbols in libgcc.lib or another standard library implementation (see here for the Microsoft Options) not being linked to. alloca and sqrtf are both standard library functions.

If you aren't linking to a standard library, then link to one by adding it to your linker library path.

From the warning above warning LNK4098, it is more likely you are linking to a standard library but the linker doesn't know which on to load.

Recommend LINKER arguments to make this problem go away (tell the linker to choose a specific standard library) are /NODEFAULTLIB:"MSVCRT" /NODEFAULTLIB:"LIBCMT.

See the following links for additional information and resources

  • Linker Tools Warning LNK4098
  • Linking problems SOLVED
  • Default Libraries in Visual C++
  • Resolving LNK4098: defaultlib 'MSVCRT' conflicts with Stack Overflow Question

这篇关于SOIL 连接不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

OpenGL transforming objects with multiple rotations of Different axis(OpenGL 变换不同轴多次旋转的对象)
GLFW first responder error(GLFW 第一响应者错误)
Core profile vs version string? Only getting GLSL 1.3/OGL 3.0 in mesa 10.0.1(核心配置文件与版本字符串?在 mesa 10.0.1 中只获得 GLSL 1.3/OGL 3.0)
What is the range of OpenGL texture ID?(OpenGL 纹理 ID 的范围是多少?)
How taxing are OpenGL glDrawElements() calls compared to basic logic code?(与基本逻辑代码相比,OpenGL glDrawElements() 调用的繁重程度如何?)
OpenGL Rotation of an object around a line(OpenGL围绕一条线旋转对象)