1


I making my first game with SFML and i got some errors. These errors show up when doinstalowałem several libraries to allow charging to play TMX files from the program Tiled. This libaries: zlib, STP (SFML TMX PARSER), PugiXML.

#include <SFML/Graphics.hpp>
#include <cstdlib>
#include <cstdio>
#include "STP/TMXLoader.hpp"
#include "player.h"

int main()
{
    player Gracz(50, 50, 50, 50, 32, 32, 5);

    sf::RenderWindow window(sf::VideoMode(640, 480), "SFML works!");
    sf::RectangleShape rectangle;
    rectangle.setSize(sf::Vector2f(Gracz.width, Gracz.height));
    rectangle.setOutlineColor(sf::Color::Red);
    rectangle.setOutlineThickness(5);

    tmx::TileMap map("maps/map1.tmx");
    map.ShowObjects();

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                exit(0);
            else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
                Gracz.changePos("up");
            else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
                Gracz.changePos("down");
            else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                Gracz.changePos("left");
            else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                Gracz.changePos("right");
        }

        window.clear();

        // Drawing map
        window.draw(map);

        rectangle.setPosition(Gracz.x, Gracz.y);
        window.draw(rectangle);
        window.display();
    }

    return 0;
}

I think I could do something bad about including libraries, but I do not see the problem. I using Visual Studio 2013 for a IDE.

My errors:

Error   6   error LNK1120: 3 unresolved externals   C:\Users\Artur1\documents\visual studio 2013\Projects\Titan Age\Debug\Titan Age.exe 1   1   Titan Age
Error   3   error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall tmx::TileMap::TileMap(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0TileMap@tmx@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main C:\Users\Artur1\documents\visual studio 2013\Projects\Titan Age\Titan Age\main.obj  Titan Age
Error   5   error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall tmx::TileMap::~TileMap(void)" (__imp_??1TileMap@tmx@@UAE@XZ) referenced in function _main   C:\Users\Artur1\documents\visual studio 2013\Projects\Titan Age\Titan Age\main.obj  Titan Age
Error   4   error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall tmx::TileMap::ShowObjects(bool)" (__imp_?ShowObjects@TileMap@tmx@@QAEX_N@Z) referenced in function _main   C:\Users\Artur1\documents\visual studio 2013\Projects\Titan Age\Titan Age\main.obj  Titan Age

Thanks for help.

AmaziR
  • 11
  • 1

0 Answers0