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

Author Topic: Cannot get -lsfml-system-s to work  (Read 1784 times)

0 Members and 1 Guest are viewing this topic.

xdflames

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Cannot get -lsfml-system-s to work
« on: February 04, 2013, 03:38:11 am »
First off, I am following this: http://sfml-dev.org/tutorials/1.6/start-cb.php
I downloaded Code::Blocks from here: http://www.codeblocks.org/downloads/26
Installed this: codeblocks-12.11mingw-setup.exe
I downloaded SFML from here: http://sourceforge.net/projects/sfml/?source=dlp
Full download.

I have followed the tutorial exactly, but I cannot get past the error:
Code: [Select]
The program can't start because sfml-system.dll is missing from your computer. Try reinstalling the program to fix this problem.
I realize this is because I do not have the .dll in the same directory as my program, but that is what I am trying to avoid. I have moved the *.a files to the Code::Blocks folder and referred to it in Other linker options: as -lsfml-system-s and it does not work.
I have also tried using the Search directories options where I pointed the compiler to the SFML-1.6\include folder and then pointed the Linker to the SFML-1.6\lib folder, yet I still do not have any luck.
Any help?
This is my code:
Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime()<< std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}
« Last Edit: February 04, 2013, 03:39:58 am by xdflames »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10907
    • View Profile
    • development blog
    • Email
Re: Cannot get -lsfml-system-s to work
« Reply #1 on: February 04, 2013, 03:54:05 am »
I suggest you read this.

As for Code::Blocks 12.11 which ships with the MinGW TDM 4.7.1 compiler, you'll have to rebuild SFML anyways on your own, or use my Nightly Builds. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

xdflames

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Cannot get -lsfml-system-s to work
« Reply #2 on: February 04, 2013, 04:03:25 am »
I suggest you read this.

As for Code::Blocks 12.11 which ships with the MinGW TDM 4.7.1 compiler, you'll have to rebuild SFML anyways on your own, or use my Nightly Builds. ;)
Interesting.. I will download 2.0, uninstall and delete everything I currently have associated with Code::Blocks (nothing else right now) then re-do it with 2.0.
Before that though, what is your Nightly Builds? The winking face intrigues me.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10907
    • View Profile
    • development blog
    • Email
Re: Cannot get -lsfml-system-s to work
« Reply #3 on: February 04, 2013, 04:06:34 am »
uninstall and delete everything I currently have associated with Code::Blocks (nothing else right now) then re-do it with 2.0.
You don't need to remove Code::Blocks, just SFML 1.6. ;D

Before that though, what is your Nightly Builds? The winking face intrigues me.
See here for more information.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

xdflames

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Cannot get -lsfml-system-s to work
« Reply #4 on: February 04, 2013, 04:20:35 am »
I still am having the same error pop up. Is there a step I am missing?

I copied over all of the *.a files (this time from the download from your link), then I copied over the contents of the include folder into the include folder of MinGW.
Then in Code::Blocks I went to the compiler settings, and in the Linker settings, Other linker options added -lsfml-system-s to the box. I also tried adding the search directories again, to no avail.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10907
    • View Profile
    • development blog
    • Email
AW: Cannot get -lsfml-system-s to work
« Reply #5 on: February 04, 2013, 04:29:51 am »
You shouldn't copy things into MinGW directories. You can hace it anywhere abd just give the path to the libs/includes.
Hace you read the official tutorials?

As for the error, you need to define SFML_STATIC if you want to use static libs, so it won't search for the dll anymore.
« Last Edit: February 04, 2013, 04:31:36 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

xdflames

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Cannot get -lsfml-system-s to work
« Reply #6 on: February 04, 2013, 04:33:45 am »
Yes, it says to move it into the /lib directory of my Code::Blocks installation, however there is NO CodeBlocks/lib, however there is a CodeBlocks/MinGW/lib, so I assumed it was supposed to go there.

And even if that is not the case, I have added the paths of the \include and \lib to the Search directories in the Code::Blocks compiler settings and it still does not work.

Edit: I also added the SFML_DYNAMIC to the #defines tab of the Compiler settings, still.. To no avail.

Edit 2:Not sure exactly what is going on. It's getting late here and I need to get up early in the morning. I will just re-install and re-do everything exactly as the tutorial, and see how that goes. I may have just over looked something. I will post back tomorrow with what happens, thanks for your help!
« Last Edit: February 04, 2013, 04:44:56 am by xdflames »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10907
    • View Profile
    • development blog
    • Email
AW: Cannot get -lsfml-system-s to work
« Reply #7 on: February 04, 2013, 11:01:35 am »
If you want to link the static libs (-s suffix) then you hace to define SFML_STATIC. if you want to use the dynamic libs, you will have to copy the .dll files (from the bin directory) next to your project file.

Also make sure to read the SFML 2 tutorial now - there's no SFML_DYNAMIC anymore.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/