Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Tiled Setup Question

This thread is locked; no one can reply to it. rss feed Print
Tiled Setup Question
variancegears
Member #23,382
June 2022

Hello,

I am trying to use Tiled (https://github.com/dradtke/allegro_tiled) and am confused as to how to set this up. I have added the header file to Microsoft Visual Studio 2022 but I am getting the following errors while trying to execute the example file that was provided in the allegro_tiled-master folder:

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_open_map referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_get_tile_width referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_get_tile_height referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_get_map_width referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_get_map_height referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_free_map referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol al_draw_map_region referenced in function main AllegroProject C:\Users\yaguc\source\repos\AllegroProject\AllegroProject\Main.obj 1

These are a bunch of linking errors that I am receiving -- isn't there supposed to be a .cpp or .c file to accompany a header file? If so why isn't it provided in the github repository / how do I fix this problem? Been trying to fix this issue for hours and at the point to paying someone to teamview my computer to get this up and running :(

DanielH
Member #934
January 2001
avatar

linking errors means you didn't link the library.

There are basically 2 parts to a library:

Header Files - provide the function declarations
Library Files - provide the function definitions

If you're confused on that, Google "declarations vs definitions"

Including header files only tells your program these extra functions exist.
You then link the library files to actually add those functions to your program.

Looks like he doesn't provide the library files. You will have to compile them yourself.

----
Since you are using MSVS you can't use the make files he included. You have 2 options.

1. include the header and source files into your project directly
2. Make a library project and add the header and source files

Go to: