How to set up Urho3D (Shared, MinGW) in Qt Creator IDE

Published February 16, 2021
Advertisement

It is so simple to set up Urho3D-1.7.1 in Qt Creator IDE on Windows 10:

1. Download and install Open Source Qt MinGW: https://www.qt.io/download-open-source

2. Download and unzip Urho3D-1.7.1-MinGW-SHARED.zip, for example, to "E:/Libs" folder

3. Run Qt Creator and create a new project: "File" > "New File or Project" > "Other Project" > "Empty qmake Project" > click the "Choose..." button > type a name of project, for example: Urho3D_QtCreator > click "Next" > "Next" > "Finish"

4. Create a "main.cpp" file and copy this code to it:

main.cpp

#include <Urho3D/Engine/Application.h>
#include <iostream>

class MyApp : public Urho3D::Application
{
public:
   MyApp(Urho3D::Context * context) : Urho3D::Application(context)
   {
   }

   virtual void Setup()
   {
       std::cout << "Setup" << std::endl;
   }
};

URHO3D_DEFINE_APPLICATION_MAIN(MyApp)

5. Copy these settings to the .pro file:

Urho3D_QtCreator.pro

CONFIG += c++11

INCLUDEPATH += "E:\Libs\Urho3D-1.7.1-MinGW-SHARED\include\Urho3D\ThirdParty"

INCLUDEPATH += "E:\Libs\Urho3D-1.7.1-MinGW-SHARED\include"
LIBS += -L"E:\Libs\Urho3D-1.7.1-MinGW-SHARED\lib\Urho3D"
LIBS += -lUrho3D -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -lSetupapi -ladvapi32 -lwinmm -limm32 -lversion -lws2_32 -ldbghelp -lopengl32 -liphlpapi

SOURCES += \
   main.cpp

6. Run the project by pressing on the green triangle button in left bottom corner (or Ctrl + R). You will see this error:

image

7. To solve this error you need to copy two folders "CoreData" and "Data" from here “E:\Libs\Urho3D-1.7.1-MinGW-SHARED\share\Urho3D\Resources” to the "debug" folder where your .exe is located

8. Run the project again and it works.

P.S. The same tutorial on official forum: https://discourse.urho3d.io/t/tutorial-how-to-set-up-urho3d-shared-mingw-in-qt-creator-ide/6715

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement