• I'm having a problem with SFML
    11 replies, posted
I just got it, i think i installed it correctly, but it's giving me link errors when compiling(same thing with the samples) My config: [img]http://i49.tinypic.com/2r3ia9i.png[/img]
You need to link against the sfml libraries. In Project properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies you need to add the sfml libraries you will be using. I normally add: [code]sfml-audio-s.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-main.lib[/code] for statically linking them.
[QUOTE=MakeR;20194704]You need to link against the sfml libraries. In Project properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies you need to add the sfml libraries you will be using. I normally add: [code]sfml-audio-s.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-main.lib[/code] for statically linking them.[/QUOTE] There is no requirement to link against sfml-main.
[QUOTE=Jallen;20194746]There is no requirement to link against sfml-main.[/QUOTE] Right, thanks. [editline]08:53PM[/editline] Removing the sfml-main dependency causes me to get a link error. [editline]08:55PM[/editline] You need sfml-main if you want to set the subsystem to windows.
Ah, thanks alot, it's working now :smile:
[QUOTE=MakeR;20194759]You need sfml-main if you want to set the subsystem to windows.[/QUOTE] No you don't. All of my SFML projects have had the subsystem on windows and I've never linked against sfml-main. It could have something to do with me using WinMain
[QUOTE=Jallen;20195182]No you don't. All of my SFML projects have had the subsystem on windows and I've never linked against sfml-main. It could have something to do with me using WinMain[/QUOTE] Yea, I am using main and relying on SFML to do the WinMain for me.
[url]http://www.sfml-dev.org/wiki/en/faq#windows_why_does_a_console_attach_itself_to_my_project[/url] Yup.
I will change that now.
[QUOTE=Jallen;20195182]No you don't. All of my SFML projects have had the subsystem on windows and I've never linked against sfml-main. It could have something to do with me using WinMain[/QUOTE] It does. Sfml-main makes it possible to use the normal main when compiling with winmain. Edit: :ninja:
It makes no difference to the size of any of my SFML projects, so I will just leave it as it was, looks nicer.
You need to add the libraries to your project. Go to: Project: Common Properties: Linker: Input: And in the additional dependencies put the libraries. Be sure to add at the end of each library a "-d" if it's compiling in debug. ;)
Sorry, you need to Log In to post a reply to this thread.