Hello I'm trying to figure out how to use classes with sfml. I know I can but this is the first i've programmed oo style. I'm fairly new to programming in C++ altogether. I'm using vs 2012 and I'm getting the error:
1>LINK : fatal error LNK1104: cannot open file 'C:\Users\brr\documents\visual studio 2012\Projects\sfmlgame\Release\sfmlgame.exe'
Here's my main.cpp:
#include "functions.h"
int main()
{
functions func;
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
bool running = true;
while (running)
{
func.window.clear();
func.window.draw(shape);
func.window.display();
}
return 0;
}
functions.h:
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include<SFML\Network.hpp>
#include <SFML/Window.hpp>
class functions
{
public:
functions(void);
~functions(void);
void Events();
void Window();
sf::RenderWindow window;
sf::Event event;
};
functions.cpp:
#include "functions.h"
functions::functions(void)
{
}
functions::~functions(void)
{
}
void functions::Window(){
window.setSize(sf::Vector2u(800,600));
window.setTitle("Test");
}
void functions::Events(){
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
}