1

working with OpenGL using the SOIL Texture binding library. However whenever I try and load a texture, I get these errors:

1>libsoil.a(stb_image_aug.o) : error LNK2019: unresolved external symbol ___chkstk_ms referenced in function _stbi_jpeg_load_from_file
1>libsoil.a(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2
1>C:\Users\Student\Dropbox\Work\Year 2\Graphics 1\Coursework\GraphicsCoursework\Debug\GraphicsCoursework.exe : fatal error LNK1120: 2 unresolved externals

The code I use to load these textures is as such:

int Platform::loadTexture(){
GLuint tex_plat = SOIL_load_OGL_texture(
            "platform.png",
            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( tex_plat > 0 )
    {
        glEnable( GL_TEXTURE_2D );
        glBindTexture( GL_TEXTURE_2D, tex_plat );
        return tex_plat;
    }
    else{
        return 0;
    }
}

Any idea as to what these errors mean?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Matt
  • 1,471
  • 8
  • 20
  • 28
  • possible duplicate of [SOIL not linking correctly](http://stackoverflow.com/questions/9629349/soil-not-linking-correctly) – genpfault Apr 05 '13 at 20:53
  • I tried what it said there. However, I can't see anything about a standard library, I thought that was done automatically? – Matt Apr 05 '13 at 22:16
  • Are you using Visual Studio? What are your project settings? Where are your SOIL files located? – derpface Apr 07 '13 at 08:36
  • Solved it, turns out I was linking to the wrong lib file. I didn't realise I had the build one of the projects that it provided to produce the relevant file. – Matt Apr 08 '13 at 23:42

0 Answers0