Linking libSOIL.a

I get a single linking error when I try to link to the static library provided with SOIL:

Error 10 error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer libSOIL.a

As far as I can see from the source, I don’t need to include any other external libraries. And I don’t want to have to compile a .dll; I’d rather it worked the way it is supposed to. So, what do I need to do?

Real quick, the error seems to pertain to the tokens being used in the SOIL function:

GLuint MSRoom::_floor = SOIL_load_OGL_texture(
“parquet.jpg”, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);

if I comment out this definition, leave the .h reference at the top and leave the linker reference where it is, it compiles fine.

Find which .a file in your “lib” folder contains that string ("_alloca") - there are around 12 results. (0 if you don’t follow http://www.chette.com/main/content/view/50/))
Try including them one by one as -lXXX cmd-params, until you find it.

I am back at trying to get SOIL to work. I understand VS2008 better now, and I have gotten other random libs and includes to work. I just tried to get SOIL to work and I get this same linking problem above :frowning:

I do not understand llian’s reply, can anybody help?

UPDATE
I decided to try and get DevIL to work while I waited for a response to SOIL’s linking problem. I get another LNK2019 error with DevIL :frowning: I still want to use SOIL, but help with either of these seemingly connected errors would be appreaciated :slight_smile:

Error 1 error LNK2019: unresolved external symbol __imp__ilLoad@8 referenced in function “void __cdecl initScene(void)” (?initScene@@YAXXZ) main.obj gl_testing_1

I get another LNK2109 error while trying to use FreeImage :frowning: :frowning: :frowning:

Can anybody help?

I believe I got SOIL to link correctly. I am going to start a thread in the beginner forums, because my textures are just flat colors…