SOIL not binding properly

I bind SOIL in my library, but when I compile, I get the following 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 linked libSOIL.lib in add dependencies.

+6
source share
3 answers

Unresolved symbol errors, error LNK2019, taken from symbols in libgcc.lib or another standard library implementation (see here for Microsoft Options), not related to them. alloca and sqrtf are standard library functions.

If you are not referencing the standard library, then reference it by adding it to your path to the linker library.

From the warning above warning LNK4098, most likely you are connecting to the standard library, but the linker does not know which one will be loaded.

We recommend LINKER arguments to fix this problem (tell the linker to select a specific standard library) / NODEFAULTLIB: "MSVCRT" / NODEFAULTLIB: "LIBCMT.

See the following links for more information and resources.

+5
source

Bug fixed.

Although I am using VC2010, I have created VC8 libraries. Then I added SOIL.lib instead of libSOIL.lib. Errors have disappeared.

+7
source

I had the same problem (using Visual Studio 2013 with the vc120 toolkit), I decided to download the SOIL library download from the official site and instead of renaming libSOIL.a to SOIL.lib I ran the VC8 solution inside the official zip code (which creates you SOIL.lib ), but I copied it to my project and the problems disappeared.

+4
source

All Articles