Link Scaleform to build applications in Qt Creator

221 Views Asked by At

I want to create an application and use Scaleform in it. I use Qt Creator so I added Scaleform's includes and libs in the .pro but I have errors at compilation. Here is what I added in the .pro (some lines may not be useful but it was only to test as it doesn't work without anyway) :

INCLUDEPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src"
INCLUDEPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src/GFx"
INCLUDEPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK   4.5/Src/Kernel"
INCLUDEPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src/Render"
INCLUDEPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Include"

DEPENDPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src"
DEPENDPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src/GFx"
DEPENDPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src/Kernel"
DEPENDPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Src/Render"
DEPENDPATH += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Include"

LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfx.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfx_air.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfx_as2.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfx_as3.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/3rdParty/pcre/Lib/Win32/Msvc14/Debug/pcre.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/3rdParty/curl-7.29.0/lib/Win32/Msvc14/Debug/libcurl.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxexpat.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxplatform_d3d9.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxplatform_d3d11.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxplatform_gl.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxrender_d3d9.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxrender_d3d11.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxrender_gl.lib"
LIBS += "C:/Program Files (x86)/Autodesk/Scaleform/GFx SDK 4.5/Lib/Win32/Msvc14/Debug/libgfxsound_fmod.lib"

In my .cpp file:

#include "GFx_Kernel.h"
#include "GFx.h"  //causes the errors
#include "GFx_Renderer_D3D9.h"

This results in the following errors :

libgfx.lib(Amp_Message.obj) : error LNK2019: unresolved external symbol _deflate referenced in function "public: virtual bool __thiscall Scaleform::GFx::AMP::Message::Compress(class Scaleform::Array<unsigned char,2,struct Scaleform::ArrayDefaultPolicy> &)const " (?Compress@Message@AMP@GFx@Scaleform@@UBE_NAAV?$Array@E$01UArrayDefaultPolicy@Scaleform@@@4@@Z)
...
...
fatal error LNK1120: 54 unresolved externals

Usually, it's due to a missing lib or a lib which is not compiled with the same compiler as the application, but here, all is built in MSVC2015, 32 bits. However, the libgfx.lib I have is dated on the 07.09.2016 and I didn't built it from Scaleform SDK since there is apparently no project to build it (whereas it's possible to rebuilt other libs like libgfxexpat.lib).

I think the problem may be due to that. Am I wrong? And is there any project in Scaleform SDK (I installed sf_4.5.32_win_vc14_lib.exe) to build that lib?

1

There are 1 best solutions below

0
On

_deflate comes from zlib, be sure you're linking it into your application. Your output claims 54 unresolved symbols - I'm going to assume it's because you haven't linked in any of Scaleform's other dependencies also.

Scaleform distributions come in a few different flavors - the 'lib' versions do not give you source code, and thus, you cannot recompile their libraries. This is useful if you want to change the compilation options, make modifications, or debug it, but otherwise you should be able to make a fully functional application with the 'lib' libraries.