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

Author Topic: Compiling Issues, Not Sure What to Do  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

BrainInaJar1245

  • Newbie
  • *
  • Posts: 21
    • View Profile
Compiling Issues, Not Sure What to Do
« on: May 01, 2012, 04:14:18 pm »
Compiling: main.cpp
C:\Users\Owner\Documents\Programming\Pong\main.cpp: In function 'int main()':
C:\Users\Owner\Documents\Programming\Pong\main.cpp:217:45: warning: comparison between 'enum sf::Event::EventType' and 'enum sf::Key::Code' [-Wenum-compare]
C:\Users\Owner\Documents\Programming\Pong\main.cpp:217:74: warning: comparison between 'enum sf::Event::EventType' and 'enum sf::Key::Code' [-Wenum-compare]
In file included from C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML\Window.hpp:37:0,
                 from C:\Users\Owner\Documents\Programming\Pong\main.cpp:15:
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/System/NonCopyable.hpp: In copy constructor 'sf::Window::Window(const sf::Window&)':
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/System/NonCopyable.hpp:57:5: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Window/Window.hpp:55:16: error: within this context
In file included from C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML\Window.hpp:35:0,
                 from C:\Users\Owner\Documents\Programming\Pong\main.cpp:15:
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/System/NonCopyable.hpp: In copy constructor 'sf::Input::Input(const sf::Input&)':
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/System/NonCopyable.hpp:57:5: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Window/Input.hpp:44:16: error: within this context
In file included from C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML\Window.hpp:37:0,
                 from C:\Users\Owner\Documents\Programming\Pong\main.cpp:15:
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Window/Window.hpp: In copy constructor 'sf::Window::Window(const sf::Window&)':
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Window/Window.hpp:55:16: note: synthesized method 'sf::Input::Input(const sf::Input&)' first required here
In file included from C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML\Graphics.hpp:38:0,
                 from C:\Users\Owner\Documents\Programming\Pong\main.cpp:17:
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Graphics/RenderWindow.hpp: In copy constructor 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)':
C:\Users\Owner\Documents\Programming\SFML-1.6\include/SFML/Graphics/RenderWindow.hpp:45:16: note: synthesized method 'sf::Window::Window(const sf::Window&)' first required here
C:\Users\Owner\Documents\Programming\Pong\main.cpp: In function 'int main()':
C:\Users\Owner\Documents\Programming\Pong\main.cpp:219:58: note: synthesized method 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)' first required here
C:\Users\Owner\Documents\Programming\Pong\main.cpp:123:6: error:   initializing argument 1 of 'void Paddle::changePosition(sf::RenderWindow, sf::Clock)'
C:\Users\Owner\Documents\Programming\Pong\main.cpp:221:45: warning: comparison between 'enum sf::Event::EventType' and 'enum sf::Key::Code' [-Wenum-compare]

Sooo.... Lots of errors and I have no clue what they're about. Help, thanks in advance? :-\
Bass gets you through in times of treble.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Compiling Issues, Not Sure What to Do
« Reply #1 on: May 01, 2012, 05:31:06 pm »
I could try to figure out what the problem is, then again I don't see any reason to use SFML 1.6, which will be 'dead' pretty soon. :P
Just use SFML 2, it'll make your life easier! (TM) ;D

And since you didn't provide any source code, we have no idea what you're trying to do....
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compiling Issues, Not Sure What to Do
« Reply #2 on: May 01, 2012, 06:21:06 pm »
I can see at least two errors:
- you copy windows and inputs, but these types are not copyable (that would make no sense), use references and/or pointers to manipulate the original objects instead of copies
- you're trying to compare an event type to a key code
Laurent Gomila - SFML developer

BrainInaJar1245

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Compiling Issues, Not Sure What to Do
« Reply #3 on: May 02, 2012, 05:39:30 pm »
https://legacy.sfmluploads.org/file/133

Here's the source. And as for SFML 2, I'm currently finishing up an independent programming class and don't have enough time to update. I probably will once I'm done with this class.
Bass gets you through in times of treble.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Compiling Issues, Not Sure What to Do
« Reply #4 on: May 02, 2012, 09:38:21 pm »
I'm not sure how you've set up your IDE and it also seems to work but you normaly use #include <SFML/foo.hpp> and not #include "SFML/foo.hpp".
Also don't use the backslash, since it's Windows specific.

For line 90 and 123, you need to define the interface with references. You don't want (and can't) to copy the window, you just want to use the existing window.
void changePosition(sf::RenderWindow&, sf::Clock&);

And for line 217 and 221: sf::Key::foo isn't an event type. The events are stored in sf::Event::.

Why do you throw exceptions when you don't catch them? (line 67, 119, 172, 176)

Have you programed in other languages before?

I hope you don't expect something to be drawn, since you don't draw anything. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BrainInaJar1245

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Compiling Issues, Not Sure What to Do
« Reply #5 on: May 03, 2012, 04:11:50 pm »
I'm not sure how you've set up your IDE and it also seems to work but you normaly use #include <SFML/foo.hpp> and not #include "SFML/foo.hpp".
Also don't use the backslash, since it's Windows specific.

Okay, changing that.

For line 90 and 123, you need to define the interface with references. You don't want (and can't) to copy the window, you just want to use the existing window.
void changePosition(sf::RenderWindow&, sf::Clock&);

Editing that, too.

And for line 217 and 221: sf::Key::foo isn't an event type. The events are stored in sf::Event::.

Why do you throw exceptions when you don't catch them? (line 67, 119, 172, 176)

Have you programed in other languages before?
1. I was trying to have an error thing. I don't know how to do that in c++.
2. I have, but this is my first time doing anything outside of the shell/console.

I hope you don't expect something to be drawn, since you don't draw anything. ;)
... Oops  :-[

I'll post the new code later, sfml uploads seems to be down.
Bass gets you through in times of treble.

 

anything