SOIL不能正确链接 [英] SOIL not linking correctly
问题描述
我在我的库中链接SOIL,但是当我编译我得到这些链接器错误:
1> LINK:warning LNK4098:defaultlib 'MSVCRT'与使用其他库冲突;使用/ NODEFAULTLIB:库
1> libSOIL.lib(stb_image_aug.o):错误LNK2019:未解析的外部符号__alloca在函数_stbi_zlib_decode_noheader_buffer中引用
1> libSOIL.lib(image_helper.o):error LNK2019:unresolved外部符号_sqrtf在函数_RGBE_to_RGBdivA2中引用
我在添加依赖关系中链接了libSOIL.lib。
如果您没有链接到标准库,则通过将其添加到您的链接器库路径来链接到它。
从上面的警告警告LNK4098,它更可能是链接到一个标准库,但链接器不知道加载哪个。
推荐LINKER参数以使此问题消失(告诉链接器选择一个特定的标准库)/ NODEFAULTLIB:MSVCRT/ NODEFAULTLIB:LIBCMT。
有关其他信息和资源,请参阅以下链接
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不能正确链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!