Click Here to Login
Join Computer forums Today

View Single Post
Old 06-20-2013, 09:52 AM   #4
Baseband Member
Join Date: Jan 2013
Location: Canada
Posts: 69
Default Re: C++ Compile error

Originally Posted by _michaelm View Post
This is a 'Linker' error, not a compiler error. As such, there is nothing wrong with your code block above. The error you're getting refers to an external resource which your application is attempting to link with called SDL_image.

Linking is the build stage which takes place after compilation. Your code is compiled into individual objects (typically libraries) and then these objects are linked together. Ultimately these will culminate in either static linking which bundle the code directly into the final executable or shared objects (.so on linux) / dynamically linked libraries (.dll on windows) where the executable reads in the libraries as and when required.

I'm guessing you took your starting point from an example project somewhere, by copying that project you've also inherited the linker settings. I don't use visual studio, so I can't give you precise directions for your UI, but I imagine if you right click your project and go to properties - then look for Linker settings - you'll find a reference somewhere to something called libSDL_image.dll or similar. Remove that reference and then try to build your project again.

As a side note, this is one of the problems I find with beginners using 'intelligent' IDEs. They are supposed to make the work easier to do, but ultimately lead to FAR more 'errors' due to their misconfiguration and they'll be much harder to find solutions for. If you can, take any single-file code samples and just run with gcc or other compiler which works outside of an IDE (integrated development environment, i.e. visual studio/eclipse/netbeans etc.). This should make your life much easier in future.

Hope that helps,
Thanks! everything works fine now, I can finally study it properly thank you so much.
jaywash is offline   Reply With Quote

All times are GMT -5. The time now is 01:40 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2020, vBulletin Solutions, Inc.