I am getting trouble from referencing a RenderWindow to another method.
I get this error:
error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
Here is the code in the main class that might assist you:
#include "stdafx.h"
stickman* player;
sf::RenderWindow window(sf::VideoMode(640, 640), "StickRPG");
player->draw(&window); // This is the piece of code that generates the error.
Here is the code in stdafx.h:
#ifndef STDAFX_H_
#define STDAFX_H_
#include "targetver.h"
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <stdio.h>
#include <tchar.h>
#include "stickman.h"
#endif /* STDAFX_H_ */
Here is the code in stickman.h:
#ifndef __STICKMAN_H_INCLUDED__
#define __STICKMAN_H_INCLUDED__
class stickman
{
public:
stickman(int, int, int);
virtual ~stickman();
void draw(sf::RenderWindow *window);
protected:
int size;
double upperarmR;
double upperarmL;
double upperlegR;
double upperlegL;
double lowerarmR;
double lowerarmL;
double lowerlegR;
double lowerlegL;
double chest;
sf::Sprite cs;
sf::Sprite llr;
sf::Sprite lll;
sf::Sprite lal;
sf::Sprite lar;
sf::Sprite ull;
sf::Sprite ulr;
sf::Sprite ual;
sf::Sprite uar;
sf::Vector2f armr;
sf::Vector2f arml;
sf::Vector2f legr;
sf::Vector2f legl;
sf::Vector2f p;
sf::Vector2f n;
};
#endif
Here is the method I am using in stickman.cpp:
void stickman::draw(sf::RenderWindow* window)
{
this->cs.setPosition(this->n.x, this->n.y);
this->ual.setPosition(this->n.x, this->n.y);
this->uar.setPosition(this->n.x, this->n.y);
this->ual.setRotation(315);
this->ual.setRotation(45);
window->draw(this->cs);
window->draw(this->ual);
window->draw(this->uar);
}
Thank you.