0

I followed the instructions to set up SFML here. When I check my /Library/Frameworks folder, all the SFML stuff seems to be there. However, when I check out a project my group is working on using SFML, and when I build, I get a ton of errors. These errors do not exist for my other group members. I think (some of) my errors are caused by SFML not recognizing sf::Input as a type.

Here is my code for one of the header classes in my project:

#pragma once
#include "Mover.h"

class InputMover : public Mover
{
public:
    InputMover(const sf::Input* pInput); 
    //error here - expected unqualified-id before * token


protected:
    const sf::Input* m_pInput;
    //error here - ISO C++ forbids declaration of Input with no type
};

The parts without errors have been taken out. What do you think the problem is?

EDIT, SOLVED: The problem was that I installed SFML with makefiles before I just did a copy-install. Some files were conflicting. I tracked down the installed files and deleted them. This seemed to fix the problem.

Daniel Kats
  • 5,141
  • 15
  • 65
  • 102

1 Answers1

0

To use the SFML classes you need to include their definitions.

Add #include <SFML/Window/Input.hpp> to the top of your file.

Also note that to use SFML you must also link to the CoreFoundation, Cocoa and OpenGL frameworks, as well as to libfreetype.

Mankarse
  • 39,818
  • 11
  • 97
  • 141