SOIL:linking soil to vc 2010

Started by
6 comments, last by nickme 11 years, 5 months ago
hi

i am trying to use soil to load a png file into the program. i changed the the name of soil.a to soil.lib as suggest by its website. and link it to vc by project property-> vc++ directory -> library. and included the soil.h to its include directory.

thanks in advance for the advice.

here is the compile errors:

1>------ Build started: Project: Fractals with zoom, Configuration: Release Win32 ------
1>Fractals with Zoom.obj : error LNK2001: unresolved external symbol _SOIL_last_result
1>Fractals with Zoom.obj : error LNK2001: unresolved external symbol _SOIL_load_OGL_texture
1>C:\Users\rob\DevC++ source\MSVC++\freeglut\fractal\Dynamical system and fractals\Fractals with Zoom\Release\Fractals with zoom.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Advertisement
Where did soil.a come from? How was it built?

Make sure that soil.a is:

  1. Built by the same version of Visual Studio as the one your project is using
  2. Built for the same architecture (x86 (32-bit) vs x64 (64-bit))
  3. Built targeting the same character set (Unicode vs Multibyte)
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

Where did soil.a come from? How was it built?

Make sure that soil.a is:

  1. Built by the same version of Visual Studio as the one your project is using
  2. Built for the same architecture (x86 (32-bit) vs x64 (64-bit))
  3. Built targeting the same character set (Unicode vs Multibyte)



hi cornstalks,

the soil.a was originally called libSOIL.a. i did not compile from the source, i don't know how sad.png

thanks

i am trying to use soil to load a png file into the program. i changed the the name of soil.a to soil.lib as suggest by its website. and link it to vc by project property-> vc++ directory -> library.

Did you only add the search directory, or did you actually link to the file? You have to do Project Properties -> Configuration Properties -> Linker -> Input and add it to Additional Dependencies.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
hi cornstalks,

does it matter if i rename libSOIL.a to SOIL.lib?

i wonder why sfml get into the linker? i set the sfml libs to other project. i did not call sfml function in this project.

i only added the search directories. after i added lib folder to additional dependencies, i got the following errors:

1>------ Build started: Project: Fractals with zoom, Configuration: Release Win32 ------
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_failure_reason already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_image_free already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_load already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_load_from_file already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_load_from_memory already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_loadf_from_memory already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_loadf already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_loadf_from_file already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_is_hdr_from_memory already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_is_hdr already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_is_hdr_from_file already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_hdr_to_ldr_gamma already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_hdr_to_ldr_scale already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_ldr_to_hdr_gamma already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_ldr_to_hdr_scale already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_zlib_decode_malloc_guesssize already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_zlib_decode_malloc already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_zlib_decode_buffer already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_zlib_decode_noheader_malloc already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_zlib_decode_noheader_buffer already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_write_bmp already defined in Soil.lib(stb_image_aug.o)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2005: _stbi_write_tga already defined in Soil.lib(stb_image_aug.o)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Soil.lib(stb_image_aug.o) : error LNK2001: unresolved external symbol __alloca
1>C:\Users\rob\DevC++ source\MSVC++\freeglut\fractal\Dynamical system and fractals\Fractals with Zoom\Release\Fractals with zoom.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You may want to ask on the SFML forums, as it looks like SFML is linking to SOIL already (which is why you're getting all these double definition errors), but apparently you can't access all of SOIL's functions (which would be why you got the first two errors).
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
hi

You may want to ask on the SFML forums, as it looks like SFML is linking to SOIL already (which is why you're getting all these double definition errors), but apparently you can't access all of SOIL's functions (which would be why you got the first two errors).


thanks for the reply.

is there a reason why i cannot access all of soil's function?

now after i deleted the sfml from the project property, i got the following errors:

1>------ Build started: Project: Fractals with zoom, Configuration: Release Win32 ------
1>libSoil.a(stb_image_aug.o) : error LNK2001: unresolved external symbol __alloca
1>libSoil.a(image_helper.o) : error LNK2001: unresolved external symbol _sqrtf
1>C:\Users\rob\DevC++ source\MSVC++\freeglut\fractal\Dynamical system and fractals\Fractals with Zoom\Release\Fractals with zoom.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
hi cornstalks,

can building my own soil library solve the problem that i had?

why i can not access certain soil function?

thanks

This topic is closed to new replies.

Advertisement