Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL SOIL library not compiling

Started by BioProton Dec 14, 2010 at 7:17 PM 5 replies 14k views
Original Post
BioProton
BioProton
Hello..... I'm new to this forum (just to let you know)....

Anyway, I recently downloaded the SOIL library for loading textures in OpenGL. For some reason, whenever I try to compile I get this error message:

1>SOIL.lib(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer
1>SOIL.lib(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2
1>programname.exe : fatal error LNK1120: 2 unresolved externals

Here is the code I'm using to load the texture (if it helps)

GLuint textureId= SOIL_load_OGL_texture("filename",SOIL_LOAD_RGB,SOIL_CREATE_NEW_ID,SOIL_FLAG_MIPMAPS);



Hopefully someone knows enough to help me fix this!!!

(btw, I am using VC++ compiler)
Sneftel
Sneftel
Compile SOIL from source, rather than using the prebuilt libs.
BioProton
BioProton
Thanks... I'm assuming you mean to compile the .lib file...

In the SOIL package (that i downloaded), there is a folder called "src" - Is this the folder with the source files to compile it (it has sources and headers)?
If so, what header should I include when I actually want to use SOIL in a project??
Sneftel
Sneftel
SOIL.h. But you don't even need to compile the lib -- if you like, you can just add the code into your main project.
BioProton
BioProton
Hmmm..... I just decided to add the header file in the project, but it still won't compile, but this time with a different error message:


1>main.obj : error LNK2019: unresolved external symbol _SOIL_load_OGL_texture referenced in function "void __cdecl initRendering(void)" (?initRendering@@YAXXZ)
1>C:\....programname.exe : fatal error LNK1120: 1 unresolved externals


It seems like there is a problem with the function used to load the texture.
(There's a code snippet of it in my first post...)
Sneftel
Sneftel
Looks like you didn't add the SOIL code, only the header file.
BioProton
BioProton
Oh... I see... Well that is a lot of source, but it does work and get the job done. The only problem is warnings of "deprecated" functions like "fopen"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.