• Advertisement
Sign in to follow this  

SOIL: new lightweight image loading lib

This topic is 2797 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I would like to use SOIL with VS 2008, but I have a problem with the library.
File libSOIL.lib I copied to VC\lib and SOIL.h to VC\include and in VS 2008 I added libSOIL.lib to the Project Properties>Configuration Properties>Linker>Input>Additional Dependencies.

#include "stdafx.h"
#include <gl\glut.h>
#include "SOIL.h"
int _tmain(int argc, _TCHAR* argv[])
{
GLuint tex_2d = SOIL_load_OGL_texture
(
"bow.bmp",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
return 0;
}


This code ganeretes these errors:
Error 1 error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer libSOIL.lib
Error 2 error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2 libSOIL.lib

Please help!

Share this post


Link to post
Share on other sites
Advertisement
I would like to ask about SOIL:

Can it flip sprites "horizontally" instead of "vertically"?

Just making sure, because it didn't say anything about horizontal flipping in this page. I'm really worried about it.

[Edited by - tom_mai78101 on May 11, 2010 3:15:42 AM]

Share this post


Link to post
Share on other sites
You shouldn't need to flip an image horizontally with the loading library. You will probably have to use something else if you really need that functionality.

Share this post


Link to post
Share on other sites
Thank you for this great library. I ripped out 2 pages of code from my old and clunky image loader (based on SDL_image) and replaced it with SOIL.

It compiled, linked and worked as expected on the first try! :)

Share this post


Link to post
Share on other sites
Hi, I am working on redhat.
Can someone exactly tell me how to link the library.
I put libSOIL.a in /usr/lib folder and SOIL.h file in /usr/include folder.

I included this line in my C++ program #include <SOIL.h>

On compiling it gives the following errors:

/tmp/cc1dkSnQ.o(.text+0x166): In function `glutDisplay()':
: undefined reference to `SOIL_load_OGL_texture'
/tmp/cc1dkSnQ.o(.text+0x17d): In function `glutDisplay()':
: undefined reference to `SOIL_last_result'
collect2: ld returned 1 exit status

Can someone please tell me what's wrong?

Share this post


Link to post
Share on other sites
Quote:
Original post by wittyameta
Hi, I am working on redhat.
Can someone exactly tell me how to link the library.
I put libSOIL.a in /usr/lib folder and SOIL.h file in /usr/include folder.

I included this line in my C++ program #include <SOIL.h>

On compiling it gives the following errors:

/tmp/cc1dkSnQ.o(.text+0x166): In function `glutDisplay()':
: undefined reference to `SOIL_load_OGL_texture'
/tmp/cc1dkSnQ.o(.text+0x17d): In function `glutDisplay()':
: undefined reference to `SOIL_last_result'
collect2: ld returned 1 exit status

Can someone please tell me what's wrong?


How are you invoking gcc? You'll probably need (iirc) a -LSOIL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement