Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SOIL:linking soil to vc 2010


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 24 November 2012 - 10:32 PM

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 ==========

Edited by nickme, 24 November 2012 - 10:40 PM.


Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 24 November 2012 - 11:20 PM

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

Make sure that soil.a is:
  • Built by the same version of Visual Studio as the one your project is using
  • Built for the same architecture (x86 (32-bit) vs x64 (64-bit))
  • Built targeting the same character set (Unicode vs Multibyte)

[ 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 ]

#3 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 24 November 2012 - 11:50 PM

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

Make sure that soil.a is:

  • Built by the same version of Visual Studio as the one your project is using
  • Built for the same architecture (x86 (32-bit) vs x64 (64-bit))
  • 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 Posted Image

thanks

Edited by nickme, 25 November 2012 - 12:31 AM.


#4 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 25 November 2012 - 12:14 AM

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.
[ 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 ]

#5 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 25 November 2012 - 12:36 AM

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 ==========

Edited by nickme, 25 November 2012 - 09:37 AM.


#6 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 25 November 2012 - 10:37 AM

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).
[ 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 ]

#7 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 25 November 2012 - 12:34 PM

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 ==========

Edited by nickme, 25 November 2012 - 01:20 PM.


#8 nickme   Members   -  Reputation: 205

Like
0Likes
Like

Posted 25 November 2012 - 02:13 PM

hi cornstalks,

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

why i can not access certain soil function?

thanks




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS