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

Author Topic: Errors  (Read 2140 times)

0 Members and 1 Guest are viewing this topic.

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Errors
« on: February 01, 2017, 12:24:59 am »
So I started to make a system of derivable classes and making a derivable class for every room, like one class is for game, and another is the main menu. So I did something like this

Code: [Select]
private:
     sf::RenderWindow window(sf::VideoMode(800, 600), "Test");

Code: [Select]
||=== Build: Debug in DirtyCraft (compiler: GNU GCC Compiler) ===|
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|9|error: expected ')' before numeric constant|
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|9|error: expected ')' before numeric constant|
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|9|error: expected ';' at end of member declaration|
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|9|error: expected unqualified-id before numeric constant|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
So I dont get why I get this

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: Errors
« Reply #1 on: February 01, 2017, 07:15:50 am »
Try:
private:
     sf::RenderWindow window = sf::RenderWindow(sf::VideoMode(800, 600), "Test");
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Errors
« Reply #2 on: February 01, 2017, 08:12:10 am »
Code: [Select]
||=== Build: Debug in DirtyCraft (compiler: GNU GCC Compiler) ===|
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|10|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11|
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\Window\Window.hpp|57|error: within this context|
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\Graphics\RenderWindow.hpp|44|note: synthesized method 'sf::Window::Window(const sf::Window&)' first required here |
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\Graphics\RenderTarget.hpp|51|error: within this context|
C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\Graphics\RenderWindow.hpp|44|note: synthesized method 'sf::RenderTarget::RenderTarget(const sf::RenderTarget&)' first required here |
C:\Users\George\Desktop\C++\DirtyCraft\Sources\GameState.h|10|note: synthesized method 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)' first required here |
||=== Build failed: 4 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
I got this, and redirect me ar 2 targets, Im sure they are visible in errors

EDIT:solved, I put it in a namespace, because I want my game to have only one window, and the sistem call it
« Last Edit: February 01, 2017, 09:41:58 am by DirtyBlasion »