I just started learning about OpenGL, and I've been trying to load an image using SOIL. I need help with resolving these error that pop up when I try building the project:
Code:
This is the code I am using:
Code:
I have the SOIL.h file in the Code::Blocks include folder, and the libSOIL.a file in the lib folder. The library file is linked to the compiler.
Code:
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glBindTexture@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glDeleteTextures@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glGenTextures@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glReadPixels@28'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glBindTexture@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glBindTexture@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glGenTextures@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glBindTexture@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glBindTexture@8'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexParameteri@12'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSOIL.a(SOIL.o):SOIL.c|| undefined reference to `glTexImage2D@36'|
||=== Build finished: 35 errors, 0 warnings (0 minutes, 1 seconds) ===|
This is the code I am using:
Code:
#include <SOIL.h>
#include <GL/gl.h>
#include <GL/glfw.h>
int main()
{
int width, height;
int frame = 0;
bool running = true;
glfwInit();
if( !glfwOpenWindow( 1600, 900, 0, 0, 0, 0, 0, 0, GLFW_FULLSCREEN ) )
{
glfwTerminate();
return 0;
}
glfwSetWindowTitle("TextureTest");
GLuint tex_2d = SOIL_load_OGL_texture (
"TestImage.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
{
frame++;
glfwGetWindowSize( &width, &height );
height = height > 0 ? height : 1;
glViewport( 0, 0, width, height );
glClearColor( 1.0f, 1.0f, 1.0f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho(0.0,width,height,0.0,-1.0,1.0);
glfwSwapBuffers();
// exit if ESC was pressed or window was closed
running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam( GLFW_OPENED);
}
glfwTerminate();
return 0;
}
I have the SOIL.h file in the Code::Blocks include folder, and the libSOIL.a file in the lib folder. The library file is linked to the compiler.