Precompiled version:
For both of them it works fine, I can create simple tutorial how to do it if somebody wants, but it is very simple and MSVC similar. Only one difference is that we should use Qt '.pro' file to use various things. To be not groundless, there's solution.
1. Let's say, that we have workspace location named "Qt_Irrlicht". Qt Creator will propose subfolder named "src" for your source files. It's the best solution.
2. After creating the project, go to this location and create "irrlicht" folder. Simply paste there header files from "include" folder from irrlicht release and libs from "lib" folder appropriate to your compiler (MSVC or MinGW/gcc).
3. There is one trick. You can add manually all Irrlicht files to your project, but it's quite messy (for precompiled version it's ok, but for source with several subfolders it would be nightmare). On addition, manually added files will be merged with your own source and header files and it will be problematic to move around your project.
The best way to use this files is to create Qt ".pri" file. Create empty file in "irrlicht" subfolder with another Irrlicht files and name it "irrlicht.pri". Structure of this file is following:
Code: Select all
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD\aabbox3d.h \
$$PWD\CDynamicMeshBuffer.h \
$$PWD\CIndexBuffer.h \
$$PWD\CMeshBuffer.h \
$$PWD\coreutil.h \
$$PWD\CVertexBuffer.h \
$$PWD\dimension2d.h
Code: Select all
SOURCES += \
$$PWD/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btDbvt.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btDispatcher.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
$$PWD/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
I'm using quite fast method to do that. Windows command:
Code: Select all
dir /s/b > index.txt
Usefull REGEXP for removing unwanted files. Choose replace and regexp from bottom, then replace this with empty phrase. Every line is another replace phrase:
".h" files
Code: Select all
^.+[^h]$
^.+[^\.]h$
Code: Select all
^.+[^p]$
^.+[^p]p$
^.+[^c]pp$
^.+[^\.]cpp$
4. When you have it done, open Qt Creator, open your ".pro" file from the project tree and paste
Code: Select all
include(irrlicht/irrlicht.pri)
(Yes, this is Polish)
5. Next step is to add precompiled libraries. You've pasted them already to the "irrlicht" directory, so the only thing to do is paste second thing to your ".pro" file.
Code: Select all
INCLUDEPATH += $$PWD/irrlicht \
DEPENDPATH += $$PWD\irrlicht \
unix:!symbian|win32: LIBS += -L$$PWD/irrlicht/ -lIrrlicht
6. After that you should add to your "main.cpp" this line and try to compile it in release/debug mode. It should compile with no errors (if this library has no errors)
Code: Select all
#include <irrlicht/irrlicht.h>
Code: Select all
!unix:!symbian|win32: LIBS += -LD:\Development\CUDA_SDK\OpenCL\common\lib\Win32 -lOpenCL
INCLUDEPATH += \
D:\Development\CUDA_SDK\OpenCL\common\inc \ #cl_gl
D:\Development\CUDA_SDK\CUDALibraries\common\inc \ #glut
DEPENDPATH += \
D:\Development\CUDA_SDK\OpenCL\common\lib\Win32 \
8. last thing. Put precompiled '.dll' files for your compiler version (MSVC or MinGW/gcc) in release / debug build location (where you '.exe' is going to show)
For example: "Qt_Irrlicht-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Release/release". It's standard name of folder which you can find in your workspace after first release compilation.
Now you should compile and run them from Qt Creator. Probably you can't still run them directly, because you have to use Qt dll's too. Default dll's are:
Code: Select all
Irrlicht:
Irrlicht.dll
QT:
libgcc_s_dw2-1.dll
mingwm10.dll
Debug:
QtCored4.dll
QtGuid4.dll
QtOpenGLd4.dll
Release:
QtCore4.dll
QtGui4.dll
QtOpenGL4.dll
Compiling from source:
Irrlicht release has both MSVC and MinGW/gcc project versions.
For MSVC it's not problem. Assuming that you have your Qt SDK configured right for MSVC, you have proper version of MSVC installed (there is no Qt with build-in MSVC compiler, but you should know that reading this thread). So, you load your ".sln" project for your version and it should work. There are many tutorials for MSVC. I'm not going to describe that, because I don't use MSVC. Idea should be similar.
For MinGW/gcc the best idea is to compile it under Code::Blocks. Eventually I've installed Code::Blocks (don't need to install build-in MinGW) and it works fine.
After installing it, go to Settings\Compiler and Debugger settings\Toolchain executabled. Then choose the same compiler you are using with Qt. Make sure, you have "g++.exe" set as default C++ compiler.
After that you should be able to create dll's and libraries (simply build all) for your compiler. For created files check "bin" and "lib" directories, it should appear there (magic).