2014-09-11 347 views
0

我必須在vs2012中解決這個問題。標題說。我在頭文件中包含SOIL.h文件。lnk2019無法解析的外部符號_soli_load_image在函數中引用_main

但是當我調試programming.it說這個錯誤。我用SOIL來畫東西。

幫我......求你...... XD

下面的代碼

#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); 
} 
+0

[什麼是未定義的引用/未解析的外部符號錯誤,以及如何解決它?:未能鏈接到相應的庫/對象文件或編譯實現文件](http://stackoverflow.com/a/12574400/902497 ) – 2014-09-11 09:08:21

回答

0

大家,我自己解決它。

導入土壤項目(您下載的)項目 - > vc8.0到您目前的解決方案。

然後從該項目中作出新的參考。

你不需要在properties-> linker中添加任何東西。

只是從該文件夾中創建一個新的參考。

相關問題