我想创建一个应用程序并在其中使用scaleform。我使用QT Creator,因此我在.pro中添加了ScaleForm的包含和Libs,但是我在编译时有错误。这是我在.pro中添加的内容(某些行可能没有用,但它只是进行测试,因为它无论如何都无法使用):
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"
在我的.cpp文件中:
#include "GFx_Kernel.h"
#include "GFx.h" //causes the errors
#include "GFx_Renderer_D3D9.h"
这会导致以下错误:
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
通常,这是由于丢失的LIB或LIB所致,该LIB与应用程序相同的编译器未编译,但是在这里,所有这些都构建在MSVC2015,32位。但是,我所拥有的libgfx.lib的日期是2016年7月9日,我没有从scaleform sdk构建它,因为显然没有项目可以构建它(而可以重建诸如libgfxexpat.lib之类的其他Libs。P>
我认为问题可能是由于那引起的。我错了吗?ScaleForm SDK(我安装了SF_4.5.32_WIN_VC14_LIB.EXE)中是否有任何项目要构建该lib?
_deflate
来自 zlib
,请确保将其链接到应用程序中。您的输出声明54个未解决的符号 - 我要假设这是因为您还没有在ScaleForm的其他依赖项中链接。
scaleform发行版有几种不同的口味 - " lib"版本没有给您源代码,因此,您无法重新编译其库。如果您想更改编译选项,进行修改或调试,这很有用,但是否则,您应该能够使用" Lib"库进行功能齐全的应用程序。