1
General / LNK 2019 error 'unresolved external symbol' with tmxlite
« on: February 04, 2018, 04:41:06 am »
I am trying to compile the SFML example that came with tmxlite just as a starting to point to start using tmxlite for my Tiled maps.
I keep getting this error:
LNK2019 unresolved external symbol _mz_inflateInit referenced in function "bool __cdecl tmx::decompress(char const *,class std::vector<unsigned char,class std::allocator > &,int,int)" (?decompress@tmx@@YA_NPBDAAV?$vector@EV?$allocator@E@std@@@std@@hh@Z)
I'm using VS Community 2017.
I was getting other similar errors before I included the tmxlite source files so I'm assuming it is requiring another source file but I think I've included them all.
Here is my main:
I keep getting this error:
LNK2019 unresolved external symbol _mz_inflateInit referenced in function "bool __cdecl tmx::decompress(char const *,class std::vector<unsigned char,class std::allocator > &,int,int)" (?decompress@tmx@@YA_NPBDAAV?$vector@EV?$allocator@E@std@@@std@@hh@Z)
I'm using VS Community 2017.
I was getting other similar errors before I included the tmxlite source files so I'm assuming it is requiring another source file but I think I've included them all.
Here is my main:
#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <tmxlite/Map.hpp>
#include "C:\Program Files (x86)\tmxlite\SFMLExample\src\SFMLOrthogonalLayer.hpp"
#include "FreeFuncs.cpp"
#include "ImageLayer.cpp"
#include "Map.cpp"
#include "miniz.c"
#include "Object.cpp"
#include "ObjectGroup.cpp"
#include "Property.cpp"
#include "TileLayer.cpp"
#include "Tileset.cpp"
#include "pugixml.cpp"
using namespace sf;
int main()
{
RenderWindow window(VideoMode(800, 600), "SFML window");
tmx::Map map;
map.load("assets/demo.tmx");
MapLayer layerZero(map, 0);
MapLayer layerOne(map, 1);
MapLayer layerTwo(map, 2);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear(Color::Black);
window.draw(layerZero);
window.draw(layerOne);
window.draw(layerTwo);
window.display();
}
return 0;
}
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <tmxlite/Map.hpp>
#include "C:\Program Files (x86)\tmxlite\SFMLExample\src\SFMLOrthogonalLayer.hpp"
#include "FreeFuncs.cpp"
#include "ImageLayer.cpp"
#include "Map.cpp"
#include "miniz.c"
#include "Object.cpp"
#include "ObjectGroup.cpp"
#include "Property.cpp"
#include "TileLayer.cpp"
#include "Tileset.cpp"
#include "pugixml.cpp"
using namespace sf;
int main()
{
RenderWindow window(VideoMode(800, 600), "SFML window");
tmx::Map map;
map.load("assets/demo.tmx");
MapLayer layerZero(map, 0);
MapLayer layerOne(map, 1);
MapLayer layerTwo(map, 2);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear(Color::Black);
window.draw(layerZero);
window.draw(layerOne);
window.draw(layerTwo);
window.display();
}
return 0;
}