Home > Blockchain >  lnk2019 unresolved external symbol _soli_load_image referenced in function _main
lnk2019 unresolved external symbol _soli_load_image referenced in function _main

Time:12-09

I have to solve this question in vs2012. title said.I included SOIL.h file in the header.

but when I debug the programming.it said this error.I am using SOIL to draw something.

help me...please... xd

Code Below:

#include <stdio.h>
#include <windows.h>
#include <conio.h>
#include <math.h>
#include <GL\glut.h>
#include <GL\GL.h>
#include <GL\GLU.h>
#include <SOIL.h>

int main(int argc,char *argv[])
{
  float pixels[]={
  0.0f, 0.0f, 0.0f,   1.0f, 1.0f, 1.0f,
  1.0f, 1.0f, 1.0f,   0.0f, 0.0f, 0.0f
};

glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,2,2,0,GL_RGB,GL_FLOAT,pixels);

int width,height;
unsigned char * image=SOIL_load_image("img.png", &width, &height, 0, SOIL_LOAD_RGB);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB,
          GL_UNSIGNED_BYTE, image);
 }

CodePudding user response:

everyone ,i solved it by myself.

import soil project(your downloaded) projects->vc8.0 to your current solution.

then make a new reference from the project.

you need not to add anything in properties->linker.

just make a new reference from that folder.

  • Related