Monday, 15 August 2011

c++ - How to link static library (of SOIL) to a project in visual studio 2010? -



c++ - How to link static library (of SOIL) to a project in visual studio 2010? -

this question has reply here:

what undefined reference/unresolved external symbol error , how prepare it? 23 answers

i need utilize soil lib @ project.

i've included @ source files director soil.h , libsoil.a (renamed libsoil.lib).

i've added header file headers existing item , include header file in header file need it.

i've tried: project properties > linker > input > additional dependencies , @ dropdown menu clicked on "< edit.. >" , typed libsoil.lib.

but getting these errors:

look below (updated errors)

what should do?

edit #1:

this doing:

#include "gl/glut.h" #include "soil.h"

i have both files @ source directory.

without code written soil build succeeds.

with code:

/* load image file straight new opengl texture */ gluint grass_texture = soil_load_ogl_texture ( "original.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 ); /* check error during load process */ if( 0 == grass_texture ) { printf( "soil loading error: '%s'\n", soil_last_result() ); }

i getting error:

error 1 error lnk2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer working_dir\libsoil.lib(stb_image_aug.o) projectname

error 2 error lnk2019: unresolved external symbol _sqrtf referenced in function _rgbe_to_rgbdiva2 working_dir\libsoil.lib(image_helper.o) projectname

error 3 error lnk1120: 2 unresolved externals working_dir\debug\projectname.exe projectname

i met same problem. solution go projects/vcx folder , compile solution myself, copied generated .lib file project. when compile solution, create sure take right platform(x86/x64). create sure path containing .lib file can found project.

c++ visual-studio-2010 opengl static-libraries soil

No comments:

Post a Comment