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

Author Topic: missing -l-lfsml-system?  (Read 4577 times)

0 Members and 1 Guest are viewing this topic.

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« on: April 22, 2011, 09:26:10 am »
Hi all, i am sooo new to c++ and extremely new to sfml, so i got this source code from someone on a different forum, and he told me to play around with it

Code: [Select]
#include <SFML/Graphics.hpp>

 int main()
 {
     // Create the main window
     sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");

     // Load a sprite to display
     sf::Image Image;
     if (!Image.LoadFromFile("tux.jpg"))  // <- save an image on your computer
         return EXIT_FAILURE;
     sf::Sprite Sprite(Image);

     // Start the game loop
     while (App.IsOpened())
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 App.Close();
         }

         // Clear screen
         App.Clear();

         // Draw the sprite
         App.Draw(Sprite);

         // Update the window
         App.Display();
     }

     return EXIT_SUCCESS;
 }



Now when i try to compile and run this, it says it cannot find -l-lfsml-system?

this is all created in a console application, and now i assume thats not what i need so im also trying to get it to run in an SFML project, but when i try and create it, and link the SFML's file location it says it cant find audio.hpp in it?

All i get is errors, errors, errors :(

I have added the inlcude and lib in the global compiler link options, and in my build options added -lfsml-system and -lfsml-graphics.

hope someone can assist me

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
missing -l-lfsml-system?
« Reply #1 on: April 22, 2011, 09:47:00 am »
Please read the official tutorial here if you have not already.

Quote from: "seerex"
Now when i try to compile and run this, it says it cannot find -l-lfsml-system?

This indicates that you didn't setup your linker setting(s) correctly.

Quote from: "seerex"
it says it cant find audio.hpp

This indicates that you didn't setup your compiler search directory correctly.

Quote from: "seerex"
in my build options added -lfsml-system and -lfsml-graphics

Try using "sfml-system" instead of "-lsfml-system" for both libraries and also add "sfml-window" since the graphics library depends on it. They need to be in the right order too because the graphics library depends on the window library and the window library depends on the system library. The graphics library should be the left-most (or top-most) library to achieve the correct order as per dependencies.

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #2 on: April 22, 2011, 10:05:35 am »
i did read the tutorial!

I dont understand why i cant set a SFML project up? it just asks me to find the directory where i installed and unpacked the SFML files, and thats what i did?

I cant edit my build options before i get a SFML project running. although i can make a console application but i kinda assume i need the SFML one?

inside the console application, even though i use the -sfml-system and the graphic / window ones, the one i put on the top is giving an error no matter which order. it cant be found.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
missing -l-lfsml-system?
« Reply #3 on: April 22, 2011, 10:23:02 am »
The tutorial is very detailed, it even has screenshots to show what you must do in the project settings. If you stick to it there's no reason to have any error ;)
Laurent Gomila - SFML developer

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #4 on: April 22, 2011, 10:43:31 am »
no doubt, but still i have :P currently my issue is that i cant even get the SFML project opened in my codeblocks? when i try to find the directory where SFML is it just says that audio file is missing, which it isnt btw.

The tutorial doesnt say anything about the fact that you are not able to even open up the SFML project, hence u arent able to mess with any build options.

I copyed the include and lib folders to my codeblocks folder like the tut says. only error i can see it might have something to do with is that codeblocks claims the variable sfml is not defined or something, but the tutorial doesnt go over something like that either.

Not saying the tut is crap, but im saying even though i follow it i encounter errors, and since these errors appear before i can create a sfml project, much of the tut is useless to me as i cant access the places it wants me to acces hence the above error.

Thanks for taking ur time to read a silly minded chap like me :) but im a bit tired of writing console apps and i wanna move on to some graphic and game programming.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
missing -l-lfsml-system?
« Reply #5 on: April 22, 2011, 11:13:50 am »
You can't even open your project?? Or are you talking about the SFML project template/wizard? Don't use it, it's just a piece of crap ;)

Create a regular Win32 GUI project and follow the tutorial.
Laurent Gomila - SFML developer

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #6 on: April 22, 2011, 11:42:55 am »
oh yea i was talking about that one :P usually i work in console applications, and i just created a win32 gui project now..

HOLY COW what on earth does all that code means? usually i have my includes and main and put my code between main and return 0; :P

Now i dont even know where to write code :P fine subject i am :P

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
missing -l-lfsml-system?
« Reply #7 on: April 22, 2011, 12:03:10 pm »
Quote
HOLY COW what on earth does all that code means?

Which code? If the Win32 GUI project creates default code, just remove it and start from scratch ;)
Laurent Gomila - SFML developer

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #8 on: April 22, 2011, 12:19:46 pm »
ah... right :P

I now tried the above code again, and it pops up with lots and lots of errors, basicly all contains Undefined reference to sf::

I added
-sfml-system
-sfml-window
-sfml-graphic

In the above order. My global compiler is linked to the include and lib as the tutorial states. I followed the tutorial best i had the skills to do, yet im errored up :S

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
missing -l-lfsml-system?
« Reply #9 on: April 22, 2011, 01:14:30 pm »
Get rid of the dashes in the libraries, ex. "-sfml-system"->"sfml-system"

There is two possible ways to write out libraries to link depending on where you're writing it to, the command version and the plain version.
I think you're writing it in an area that doesn't want the command version.

The command version is "-lsfml-system"
The plain version is "sfml-system"

Quote from: "seerex"
-lfsml-system and -lfsml-graphics

Also, I didn't notice before, but you spelled "sfml" wrong...

Try both the command version and plain version to see what works.

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #10 on: April 22, 2011, 01:40:59 pm »
i'll be damned, i got it to open my png picture of a penguin! :)

now thats a huge step, thanks A LOT for ur feedback. i kinda noticed a "mistake" in one of the tutorial screenshots. Where it says to link the sfml-system etc, it has marked the "release" in the left side of the picture. i then thought i should add it under release, which, btw, you shouldnt :)

what i get when i run my program
first i get an error? saying c:\windows\system32\atigktxx.dll is not supposed to run on windows or contains an error.
i press "ok" and an empty console window and another window containing my image pops up.

Guess its working? :) but should i care about the error or ignore it?

yet again! thanks A LOT for your help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
missing -l-lfsml-system?
« Reply #11 on: April 22, 2011, 05:50:55 pm »
Quote
i kinda noticed a "mistake" in one of the tutorial screenshots. Where it says to link the sfml-system etc, it has marked the "release" in the left side of the picture. i then thought i should add it under release, which, btw, you shouldnt

It's not a mistake. There are always two build configurations available: debug and release. You're supposed to use both when developping, so you must set them up correctly. The tutorial shows a screenshot for the release configuration, but you must do the same thing for debug.

Quote
first i get an error? saying c:\windows\system32\atigktxx.dll is not supposed to run on windows or contains an error.
i press "ok" and an empty console window and another window containing my image pops up.

Did you get this DLL from somewhere else than your graphics driver?
Laurent Gomila - SFML developer

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #12 on: April 22, 2011, 06:14:22 pm »
[/quote]
Did you get this DLL from somewhere else than your graphics driver?[/quote]

Thats the only error i get, not comming from anywhere else i dont think so atleast.? not entirely sure i understand ur question though :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
missing -l-lfsml-system?
« Reply #13 on: April 22, 2011, 06:17:19 pm »
I was just asking if you had copied this DLL manually :)
Laurent Gomila - SFML developer

seerex

  • Newbie
  • *
  • Posts: 12
    • View Profile
missing -l-lfsml-system?
« Reply #14 on: April 24, 2011, 07:19:01 pm »
i did copy it manually yes :) sry for the slow reply, got hung up on working 12 hours a day :P