Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Failing to link SFML 2.0 with CodeLite  (Read 4613 times)

0 Members and 5 Guests are viewing this topic.

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Failing to link SFML 2.0 with CodeLite
« on: March 05, 2013, 09:56:24 pm »
I'v been trying to get this to work but I can't figure out what is wrong.

Linker Output:


Source Code:
#include <iostream>
#include <SFML\Graphics.hpp>

int main( int argc, char** argv )
{
        sf::RenderWindow window;
        window.create(sf::VideoMode(800,600,32), "SFML WINDOW");
        sf::Event event;
       
        while(window.isOpen())
        {
                while(window.pollEvent(event))
                {
                       
                }
                window.display();
        }
        return 0;
}

Compiler Settings:


Linker Settings:


Linker Libraries:


Anyone know what I'm doing wrong?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failing to link SFML 2.0 with CodeLite
« Reply #1 on: March 05, 2013, 10:05:16 pm »
The order of the libraries to link are important.

sfml-graphics depends on sfml-window, which depends on sfml-system
sfml-network depends on sfml-system
sfml-audio depends on sfml-system

Thus the order needs to be for example:
sfml-graphics
sfml-window
sfml-audio
sfml-network
sfml-system

(Don't forget the suffixes :D )
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Failing to link SFML 2.0 with CodeLite
« Reply #2 on: March 05, 2013, 10:18:53 pm »
The order of the libraries to link are important.

sfml-graphics depends on sfml-window, which depends on sfml-system
sfml-network depends on sfml-system
sfml-audio depends on sfml-system

Thus the order needs to be for example:
sfml-graphics
sfml-window
sfml-audio
sfml-network
sfml-system

(Don't forget the suffixes :D )
Of course! I haven't bothered with the other compilers seeing as they simply haven't cared at all! Though CodeLite don't spoil me as much I guess.

Now a bit of topic, but do you know by ANY chance how I disable to console?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failing to link SFML 2.0 with CodeLite
« Reply #3 on: March 05, 2013, 10:29:05 pm »
I haven't bothered with the other compilers seeing as they simply haven't cared at all!
I guess with 'other' you mean VS, because all GCC versions require a fixed order, it's also not really IDE related. ;)

Now a bit of topic, but do you know by ANY chance how I disable to console?
I presume it's about the same as on Code::Blocks (see here). You'll need to change the subsystem project settings to window and link against sfml-main.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Failing to link SFML 2.0 with CodeLite
« Reply #4 on: March 06, 2013, 02:19:26 pm »
I mean Code::Blocks ( The original order was a direct copy-paste from my other project in C::B ).
Anyways, how do one figure out which order they should be called in?
« Last Edit: March 06, 2013, 02:28:01 pm by Moonkis »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failing to link SFML 2.0 with CodeLite
« Reply #5 on: March 06, 2013, 02:27:42 pm »
I mean Code::Blocks ( The original order was a direct copy-paste from my other project in C::B )
As I already stated a IDE has nothing to do with the order, that entirely depends on the compiler. If you used GCC with C::B then the old order shouldn't have worked. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything