SOIL不能正确链接 [英] SOIL not linking correctly

查看:1342
本文介绍了SOIL不能正确链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的库中链接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。

此处为Microsoft选项)未链接到。 alloca和sqrtf都是标准库函数。



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



从上面的警告警告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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆