0

I'm trying to use the SOIL library with freeglut and glew. I'm using Visual Studio 2012 on a Windows 8, 64bit laptop. I'm getting these errors:

1>libSOIL.a(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>libSOIL.a(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2
1>C:\Users\UserName\documents\visual studio 2012\Projects\VectorTest\Debug\testSOIL.exe : fatal error LNK1120: 2 unresolved externals

I found a lot of other SO questions about linking to the SOIL library, but none worked for me. Some suggested linking in other libraries (but those seemed to be gcc specific - it was libgcc.a), others suggested building the SOIL library again.

The source code contains projects for vc6 through vc9. I built the vc9 project and tried using it - it didn't work. When I tried to build my program, it said 'The application was unable to start correctly (0xc000007b)'. I tried making a new static library project with the source code and building that, but I got the same 0xc000007b error.

It seems that this 0xc000007b error is characteristic of using a 32bit library on a 64bit computer or vice versa. However, the SOIL library doesn't come in a 64bit/32bit mode. I've tried compiling for x64 instead of x86 but that didn't seem to work either.

What do I need to do in order to get this working?

Numeri
  • 1,027
  • 4
  • 14
  • 32
  • Any help? I'd really like to fix this! :) – Numeri Dec 25 '13 at 21:34
  • Compiling FreeGLUT and SOIL (statically) for X64 worked for me. As did Win32. – genpfault Dec 26 '13 at 06:23
  • Also, is it *your* program that's failing to start correctly, or the compiler? "When I tried to **build** my program it said 'The application was unable to start correctly..." seems to imply the compiler is misbehaving. – genpfault Dec 26 '13 at 06:29
  • I'm sorry for the unclear wording! The application starts up - a window is initialized. However, within half a second of beginning, a message box pops up displaying the aforementioned message. Thanks! – Numeri Dec 26 '13 at 19:16
  • That's...pretty funky. Give [these static 32-bit libraries](http://fsrv.dyndns.org/~genpfault/so/20415381/gl-libs.7z) a try. Make sure you set up your project to use the static runtimes (`/MTd` and `/MT`) too. – genpfault Dec 26 '13 at 21:36
  • How do you want me to use those libraries? Here's my [code](http://ideone.com/c2oSc7). I added the libraries in the list of additional dependencies (and pasted them into the lib folder of visual studio's vc++). I also used `/MT` and `/MTd` too. Neither worked - I got the `0xc000007b` error again. – Numeri Jan 25 '14 at 23:29
  • @genpfault oops, forgot to @ you! – Numeri Feb 20 '14 at 03:54

0 Answers0