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

Author Topic: Tutorial not helping  (Read 4103 times)

0 Members and 1 Guest are viewing this topic.

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Tutorial not helping
« on: June 15, 2013, 04:30:04 pm »
I am working through thye window tutorial:
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    return 0;
}

and these errors occurred:
class sf::Window has no member named "is open"
and the same error for other members.


The code is copied straight from the tutorial.

I am using linux Ubuntu with codeblocks.

Please help

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Tutorial not helping
« Reply #1 on: June 15, 2013, 04:42:50 pm »
« Last Edit: June 15, 2013, 04:44:46 pm by The Hatchet »

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #2 on: June 15, 2013, 06:32:00 pm »
It automatically installed all the libraries from the ubuntu software manager.  The default code-blocks program works but no other program I have tried.  I followed the above links and they didn't help.

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Tutorial not helping
« Reply #3 on: June 15, 2013, 06:35:26 pm »
Did ubuntu install the SFML2.0 libraries or the 1.6?  Some method calls were changed in between the versions, I think 1.6 had capital calls, 'IsOpen()" as opposed to 2.0 'isOpen()'

I've also never developed on a linux distro so I can't help you with any info on your linker settings, which may also be the case.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
Re: Tutorial not helping
« Reply #4 on: June 15, 2013, 08:13:07 pm »
Haven't been on Ubuntu for a while, but I don't think they've already switched to SFML 2.0, thus you'll have to recompile & install SFML on your own, without the package manager (see the CMake tutorial).

Working with SFML 1.6 is not recommended, since it's outdated, unmaintained, buggy and lacks quite a few features. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #5 on: June 15, 2013, 09:46:08 pm »
I only started with Linux yesterday.  Please, I am a n00b!

Can someone just tell me what to do.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Tutorial not helping
« Reply #6 on: June 16, 2013, 12:48:50 am »
I only started with Linux yesterday.  Please, I am a n00b!

Can someone just tell me what to do.

We already told you what to do, if ubuntu automatically installed SFML 1.6 then uninstall it and compile from the source.  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Tutorial not helping
« Reply #7 on: June 16, 2013, 01:12:37 am »
In your console, type:
sudo apt-add-repository ppa:sonkun/sfml-development
sudo apt-get update
sudo apt-get install libsfml-dev

Optionally:
sudo apt-get install sfml-examples
sfml-shader # should run the shader example
« Last Edit: June 16, 2013, 01:14:09 am by Sonkun »
Interested in using SFML with Python ? Try out its Python binding!

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #8 on: June 16, 2013, 08:03:19 am »
did that it says I have the latest version.  I have also downloaded it from the sfml website and tried linking it to code::blocks but it doesn't work.

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #9 on: June 16, 2013, 01:34:30 pm »
Quote
We already told you what to do, if ubuntu automatically installed SFML 1.6 then uninstall it and compile from the source.  ;)

How do you do this? 

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #11 on: June 16, 2013, 07:54:28 pm »
Still not working  :(
so far:
I have downloaded code blocks and g++ from the ubuntu app store and this works with c++ standard
I have tried sfml 1.6 from app store
I have downloaded sfml 2.0
I have tried all above

in cmake this error occurred
CMake Error at CMakeLists.txt:4 (add_subdirectory):
  add_subdirectory given source "bash-completion" which is not an existing
  directory.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Tutorial not helping
« Reply #12 on: June 16, 2013, 08:16:25 pm »
Maybe google some tutorials for making sure your dev environment is setup corretly first.  Then google some tutorials on compiling from source on linux then give it another shot.  Maybe SFML didn't get installed into your systems Standard Path for some reason.  Or if you are using code blocks 12.11 it won't work with the 'official' SFML release and you need to download a nightly build.  I know the Windows version has this problem, the linux may have the same.

Maybe developing on a Linux Distro is just a tad out of reach for your knowledge base right now.  I know that even using any flavor of linux requires a decent chunk of knowledge on how to do things like pull from repositories and compile from source to get a certain program to work on your specific distro.  Everytime I've ever even touched linux I break it beyond usability within a day.  I can imagine trying to set up a developement environment is an even bigger headache than general usage.  Heck, even just getting a dev environment setup under windows can be nerve racking and thats usually just unzip, set linker settings and your golden.

yup790

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tutorial not helping
« Reply #13 on: June 17, 2013, 07:22:39 pm »
Solved.  I manually installed the sfml libary to standered path - at least, I think I did it manually, the sudp apt-get install thing might have done it.  Then with code::blocks I chose sfml project.

I want to thank the hatchet for his/her help

Lethn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Tutorial not helping
« Reply #14 on: June 17, 2013, 07:30:46 pm »
There are also two versions of SFML 2.0, codeblocks comes with both the .DLL's of the two different SFML versions for some reason, this caught me out when I first started.