Soil image loader problem

i'm using code blocks and for some reason the error only points to the closing parenthesis of the "SOIL_load_OGL_texture function.. i've tried a whole bunch of things.. has any body ran into this problem before. can you help me please..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int LoadImage()
{

 texture[0] = SOIL_load_OGL_texture("data/Terrain.png",
                                    SOIL_LOAD_AUTO,
                                    SOIL_CREATE_NEW_ID,
                                    SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_INVERT_Y
                                      );

     if(texture[0] == 0)
		return false;


    // Typical Texture Generation Using Data From The Bitmap
	glBindTexture(GL_TEXTURE_2D, texture[0]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

	return true;
}
Last edited on
Looks ok to me, are you sure you are linking to SOIL correctly? Also paste exactly what the error message says.
i use the default settings so i only get a red lil square on the line of code that has the error no description.. can you tell me how to get it?
ok i found out about the log..

||=== Build: Debug in project c++ (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `Z10LoadImageAv':|
C:\Users\Juice\Documents\C++ Assignments\project c++\main.cpp|28|undefined reference to `SOIL_load_OGL_texture'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
You have a linking error, you haven't linked to SOIL correctly, as @James2250. In your build options for the project, go to linking, and add libSOIL.a (or SOIL.lib or whatever its called) to the list, then try again. I haven't used SOIL, so I can't particularly give fully accurate information.
thanks but i tried it and it ouputed way more errors... its libSOIL.a
well i just found out that you have to add it to the link library before any other links.. ran perfectly.. thanks..
Topic archived. No new replies allowed.