# How to create new Tilesets

**URL:** <https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658>\
**Category:** Questions\
**Created:** [September 24, 2025, 11:47am UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658 "2025-09-24T11:47:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zRapiid](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/zrapiid/32/5217_2.png) [@zRapiid](https://discourse.mapeditor.org/u/zRapiid)\
**Post date:** [September 24, 2025, 11:47am UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658/1 "2025-09-24T11:47:44Z")

</div>

I have build only the libtiled library from the source files, and used it to import it into a C++ app.  
I am currently just playing around with it, but when I try to create a tileset;

```cpp
auto tileset = Tiled::Tileset::create(“DummyTileset”, 32, 32, 0, 0);

```

It keeps giving me the error:

`QPixmap: Must construct a QGuiApplication before a QPixmap`

At the start of my main() function, I did create an QGuiApplication though.

```cpp
QGuiApplication app(argc, argv);

```

Even if my application is only:

```cpp
int main(int argc, char* argv[])
{
    QGuiApplication app(argc, argv);
    auto tileset = Tiled::Tileset::create("DummyTileset", 32, 32, 0, 0);
    std::cout << "It worked\n";
    return 0;
}

```

I have looked through the source code, but since I have a novice understanding of C++, I can’t find the issue.  
I hope someone can help me to the right trail, thank you.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [September 24, 2025, 1:54pm UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658/2 "2025-09-24T13:54:18Z")

</div>

Hmm, that’s odd. Using Tiled 1.11.2 I can’t reproduce this on Fedora (I’ve installed `tiled-devel`):

```sh
bjorn@thor:libtiled_example$ cat libtiled_example.pro 
TEMPLATE = app
TARGET = libtiled_example
LIBS += -ltiled
SOURCES += main.cpp
bjorn@thor:libtiled_example$ cat main.cpp
#include <QGuiApplication>
#include "tiled/tileset.h"
#include <iostream>

int main(int argc, char* argv[])
{
    QGuiApplication app(argc, argv);
    auto tileset = Tiled::Tileset::create("DummyTileset", 32, 32, 0, 0);
    std::cout << "It worked\n";
    return 0;
}
bjorn@thor:libtiled_example$ ./libtiled_example 
It worked

```

Can you provide more information that’d allow me to reproduce this issue?

---

<div class="post-metadata">

**Author:** ![zRapiid](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/zrapiid/32/5217_2.png) [@zRapiid](https://discourse.mapeditor.org/u/zRapiid)\
**Post date:** [September 24, 2025, 7:01pm UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658/3 "2025-09-24T19:01:10Z")

</div>

I am using debug mode, in Visual Studio 2022. I did make sure to build the library .qbs with those that version in mind. The code is also made in VS, maybe that can make a difference?

---

<div class="post-metadata">

**Author:** ![zRapiid](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/zrapiid/32/5217_2.png) [@zRapiid](https://discourse.mapeditor.org/u/zRapiid)\
**Post date:** [September 25, 2025, 12:24pm UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658/4 "2025-09-25T12:24:05Z")

</div>

To add to that, I installed Qt with MSVC2022 aswell (Windows 11). I only build the .qbs file from the libtiled folder (from the github ./src). The rest of the github(‘s source files) I did not build.

---

<div class="post-metadata">

**Author:** ![zRapiid](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/zrapiid/32/5217_2.png) [@zRapiid](https://discourse.mapeditor.org/u/zRapiid)\
**Post date:** [September 30, 2025, 12:01pm UTC](https://discourse.mapeditor.org/t/how-to-create-new-tilesets/7658/5 "2025-09-30T12:01:00Z")

</div>

I think the problem lied by the way I built the Tiled library. An other member of my project group built it with CMake instead of the .qbs and that one does work.
