Creating a mex file linked to Intel's ipp library - c++

I'm trying to improve my matlab code performance by replacing a part of it with a a c++ program, and for that I'm using intel's ipp library. The problem occurs when trying to compile and link the program. I get the added error.
I'm using Matlab2016a 64bit, Windows 10 64bit and Building with 'Microsoft Visual C++ 2015 Professional'.
Thank you!
Nadav
mex nesta.cpp -L'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\lib\intel64_win' -I'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\include' Building with 'Microsoft Visual C++ 2015 Professional'.
Error using mex
Creating library nesta.lib and object nesta.exp
nesta.obj : error LNK2019: unresolved external symbol ippsAdd_32fc_I referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsAdd_32fc referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsMulC_32fc referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsMul_32fc referenced in function "void __cdecl
perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint##YAXPEAUIpp32fc##M0PEAM#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsSub_32fc_I referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsSub_32fc referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsDiv_32fc_I referenced in function "void __cdecl
perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint##YAXPEAUIpp32fc##M0PEAM#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsConj_32fc referenced in function "void __cdecl
perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint##YAXPEAUIpp32fc##M0PEAM#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsSum_32fc referenced in function "void __cdecl
perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint##YAXPEAUIpp32fc##M0PEAM#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsMax_32f referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsNorm_L2_32fc64f referenced in function "void __cdecl
perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint##YAXPEAUIpp32fc##M0PEAM#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsDFTInit_C_32fc referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.obj : error LNK2019: unresolved external symbol ippsDFTFwd_CToC_32fc referenced in function "void __cdecl A(struct Ipp32fc
*,struct Ipp32fc *,struct DFTSpec_C_32fc *)" (?A##YAXPEAUIpp32fc##0PEAUDFTSpec_C_32fc###Z)
nesta.obj : error LNK2019: unresolved external symbol ippsDFTInv_CToC_32fc referenced in function "void __cdecl At(struct Ipp32fc
*,struct Ipp32fc *,struct DFTSpec_C_32fc *)" (?At##YAXPEAUIpp32fc##0PEAUDFTSpec_C_32fc###Z)
nesta.obj : error LNK2019: unresolved external symbol ippsAbs_32fc_A11 referenced in function "int __cdecl nesta(struct Ipp32fc
*,struct Ipp32fc *)" (?nesta##YAHPEAUIpp32fc##0#Z)
nesta.mexw64 : fatal error LNK1120: 15 unresolved externals`enter code here

looks like i solved it. the -l flag didn't work as I expected.
this command worked:
mex 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\lib\intel64_win\*.lib' nesta.cpp -I'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\include'

Related

ASIOSDK; Error when building mex file from hostsample.cpp

I'm writing a c++ file to build into mex, but I got the unsolved external symbol errors with asio function like "ASIOExit". I'm building in Matlab console with mex command.
I've put all headfiles and cppfiles from the AsioSDK. into one folder ad used -I to include that folder. What else do I need to include or link?
The 3 headfiles related to ASIO has already been added in include.
#include "asiosys.h"
#include "asio.h"
#include "asiodrivers.h"
Error using mex Creating library hostsample.lib and object
hostsample.exp hostsample.obj : error LNK2019: unresolved external
symbol "long __cdecl ASIOInit(struct ASIODriverInfo *)"
(?ASIOInit##YAJPEAUASIODriverInfo###Z) referenced in function
mexFunction hostsample.obj : error LNK2019: unresolved external symbol
"long __cdecl ASIOExit(void)" (?ASIOExit##YAJXZ) referenced in
function mexFunction hostsample.obj : error LNK2019: unresolved
external symbol "long __cdecl ASIOStart(void)" (?ASIOStart##YAJXZ)
referenced in function mexFunction hostsample.obj : error LNK2019:
unresolved external symbol "long __cdecl ASIOStop(void)"
(?ASIOStop##YAJXZ) referenced in function mexFunction hostsample.obj :
error LNK2019: unresolved external symbol "long __cdecl
ASIOGetChannels(long *,long *)" (?ASIOGetChannels##YAJPEAJ0#Z)
referenced in function "long __cdecl init_asio_static_data(struct
DriverInfo *)" (?init_asio_static_data##YAJPEAUDriverInfo###Z)
hostsample.obj : error LNK2019: unresolved external symbol "long
__cdecl ASIOGetLatencies(long *,long *)" (?ASIOGetLatencies##YAJPEAJ0#Z) referenced in function "long __cdecl
create_asio_buffers(struct DriverInfo *)"
(?create_asio_buffers##YAJPEAUDriverInfo###Z) hostsample.obj : error
LNK2019: unresolved external symbol "long __cdecl
ASIOGetBufferSize(long *,long *,long *,long *)"
(?ASIOGetBufferSize##YAJPEAJ000#Z) referenced in function "long
__cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data##YAJPEAUDriverInfo###Z) hostsample.obj : error
LNK2019: unresolved external symbol "long __cdecl
ASIOGetSampleRate(double *)" (?ASIOGetSampleRate##YAJPEAN#Z)
referenced in function "long __cdecl init_asio_static_data(struct
DriverInfo *)" (?init_asio_static_data##YAJPEAUDriverInfo###Z)
hostsample.obj : error LNK2019: unresolved external symbol "long
__cdecl ASIOSetSampleRate(double)" (?ASIOSetSampleRate##YAJN#Z) referenced in function "long
__cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data##YAJPEAUDriverInfo###Z) hostsample.obj : error
LNK2019: unresolved external symbol "long __cdecl
ASIOGetSamplePosition(struct ASIOSamples *,struct ASIOTimeStamp *)"
(?ASIOGetSamplePosition##YAJPEAUASIOSamples##PEAUASIOTimeStamp###Z)
referenced in function "void __cdecl bufferSwitch(long,long)"
(?bufferSwitch##YAXJJ#Z) hostsample.obj : error LNK2019: unresolved
external symbol "long __cdecl ASIOGetChannelInfo(struct
ASIOChannelInfo *)" (?ASIOGetChannelInfo##YAJPEAUASIOChannelInfo###Z)
referenced in function "long __cdecl create_asio_buffers(struct
DriverInfo *)" (?create_asio_buffers##YAJPEAUDriverInfo###Z)
hostsample.obj : error LNK2019: unresolved external symbol "long
__cdecl ASIOCreateBuffers(struct ASIOBufferInfo *,long,long,struct ASIOCallbacks *)"
(?ASIOCreateBuffers##YAJPEAUASIOBufferInfo##JJPEAUASIOCallbacks###Z)
referenced in function "long __cdecl create_asio_buffers(struct
DriverInfo *)" (?create_asio_buffers##YAJPEAUDriverInfo###Z)
hostsample.obj : error LNK2019: unresolved external symbol "long
__cdecl ASIODisposeBuffers(void)" (?ASIODisposeBuffers##YAJXZ) referenced in function mexFunction hostsample.obj : error LNK2019:
unresolved external symbol "long __cdecl ASIOOutputReady(void)"
(?ASIOOutputReady##YAJXZ) referenced in function "struct ASIOTime *
__cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long,class std::vector
,class std::allocator > > >)"
(?bufferSwitchTimeInfo##YAPEAUASIOTime##PEAU1#JJV?$vector#V?$vector#NV?$allocator#N#std###std##V?$allocator#V?$vector#NV?$allocator#N#std###std###2##std###Z)
hostsample.obj : error LNK2019: unresolved external symbol
__imp_timeGetTime referenced in function "struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long,class
std::vector
,class std::allocator > > >)"
(?bufferSwitchTimeInfo##YAPEAUASIOTime##PEAU1#JJV?$vector#V?$vector#NV?$allocator#N#std###std##V?$allocator#V?$vector#NV?$allocator#N#std###std###2##std###Z)
hostsample.obj : error LNK2019: unresolved external symbol "public:
void __cdecl AsioDrivers::removeCurrentDriver(void)"
(?removeCurrentDriver#AsioDrivers##QEAAXXZ) referenced in function
mexFunction hostsample.obj : error LNK2019: unresolved external symbol
"bool __cdecl loadAsioDriver(char *)" (?loadAsioDriver##YA_NPEAD#Z)
referenced in function mexFunction hostsample.obj : error LNK2019:
unresolved external symbol "struct ASIOTime * __cdecl
bufferSwitchTimeInfo(struct ASIOTime *,long,long)"
(?bufferSwitchTimeInfo##YAPEAUASIOTime##PEAU1#JJ#Z) referenced in
function "void __cdecl bufferSwitch(long,long)"
(?bufferSwitch##YAXJJ#Z) hostsample.obj : error LNK2019: unresolved
external symbol "class AsioDrivers * asioDrivers"
(?asioDrivers##3PEAVAsioDrivers##EA) referenced in function
mexFunction hostsample.mexw64 : fatal error LNK1120: 19 unresolved
externals
OK looks like I haven't included all the cpp and h files in the solution.

OpenGL linking error while building Qt 5.9 project on Windows

I'm trying to build a Qt 5.9 project on Windows with MSVC2017 64bit and using prebuilt Qt binaries.
The project depends on QNanoPainter to create custom items which uses NanoVG as its rendering backend that makes raw OpenGL calls.
When trying to build it seems like its linking to system version OpenGL, which on Windows is 1.0, and return lots of unresolved external symbols, that, if I'm not mistaken, are all functions not present on OpenGL 1.0. You can see a list of the unresolved symbols below.
I've already tried various solutions like adding LIBS += opengl32.lib to my .pro file but it keeps linking to system version. GPU drivers are updated to latest version. It's not a problem of not regenerated Makefiles since I run qmake each time I modified the .pro.
How could I link the correct OpenGL version so that compilation returns successfully?
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glBindTexture referenced in function "void __cdecl glnvg__bindTexture(struct GLNVGcontext *,unsigned int,unsigned int)" (?glnvg__bindTexture##YAXPEAUGLNVGcontext##II#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glBlendFunc referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glColorMask referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glCullFace referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glDeleteTextures referenced in function "int __cdecl glnvg__deleteTexture(struct GLNVGcontext *,int)" (?glnvg__deleteTexture##YAHPEAUGLNVGcontext##H#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glDisable referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glDrawArrays referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glEnable referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glFinish referenced in function "int __cdecl glnvg__renderCreate(void *)" (?glnvg__renderCreate##YAHPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glFrontFace referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glGenTextures referenced in function "int __cdecl glnvg__renderCreateTexture(void *,int,int,int,int,unsigned char const *)" (?glnvg__renderCreateTexture##YAHPEAXHHHHPEBE#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glGetError referenced in function "void __cdecl glnvg__checkError(struct GLNVGcontext *,char const *,int)" (?glnvg__checkError##YAXPEAUGLNVGcontext##PEBDH#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glPixelStorei referenced in function "int __cdecl glnvg__renderCreateTexture(void *,int,int,int,int,unsigned char const *)" (?glnvg__renderCreateTexture##YAHPEAXHHHHPEBE#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glStencilFunc referenced in function "void __cdecl glnvg__stencilFunc(struct GLNVGcontext *,unsigned int,int,unsigned int)" (?glnvg__stencilFunc##YAXPEAUGLNVGcontext##IHI#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glStencilMask referenced in function "void __cdecl glnvg__stencilMask(struct GLNVGcontext *,unsigned int)" (?glnvg__stencilMask##YAXPEAUGLNVGcontext##I#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glStencilOp referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glTexImage2D referenced in function "int __cdecl glnvg__renderCreateTexture(void *,int,int,int,int,unsigned char const *)" (?glnvg__renderCreateTexture##YAHPEAXHHHHPEBE#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glTexParameteri referenced in function "int __cdecl glnvg__renderCreateTexture(void *,int,int,int,int,unsigned char const *)" (?glnvg__renderCreateTexture##YAHPEAXHHHHPEBE#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol __imp_glTexSubImage2D referenced in function "int __cdecl glnvg__renderUpdateTexture(void *,int,int,int,int,int,unsigned char const *)" (?glnvg__renderUpdateTexture##YAHPEAXHHHHHPEBE#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glActiveTexture referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glBindBuffer referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glDeleteBuffers referenced in function "void __cdecl glnvg__renderDelete(void *)" (?glnvg__renderDelete##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGenBuffers referenced in function "int __cdecl glnvg__renderCreate(void *)" (?glnvg__renderCreate##YAHPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glBufferData referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glStencilOpSeparate referenced in function "void __cdecl glnvg__fill(struct GLNVGcontext *,struct GLNVGcall *)" (?glnvg__fill##YAXPEAUGLNVGcontext##PEAUGLNVGcall###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glAttachShader referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glBindAttribLocation referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glCompileShader referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glCreateProgram referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glCreateShader referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glDeleteProgram referenced in function "void __cdecl glnvg__deleteShader(struct GLNVGshader *)" (?glnvg__deleteShader##YAXPEAUGLNVGshader###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glDeleteShader referenced in function "void __cdecl glnvg__deleteShader(struct GLNVGshader *)" (?glnvg__deleteShader##YAXPEAUGLNVGshader###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glDisableVertexAttribArray referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glEnableVertexAttribArray referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGetProgramiv referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGetProgramInfoLog referenced in function "void __cdecl glnvg__dumpProgramError(unsigned int,char const *)" (?glnvg__dumpProgramError##YAXIPEBD#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGetShaderiv referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGetShaderInfoLog referenced in function "void __cdecl glnvg__dumpShaderError(unsigned int,char const *,char const *)" (?glnvg__dumpShaderError##YAXIPEBD0#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glGetUniformLocation referenced in function "void __cdecl glnvg__getUniforms(struct GLNVGshader *)" (?glnvg__getUniforms##YAXPEAUGLNVGshader###Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glLinkProgram referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glShaderSource referenced in function "int __cdecl glnvg__createShader(struct GLNVGshader *,char const *,char const *,char const *,char const *,char const *)" (?glnvg__createShader##YAHPEAUGLNVGshader##PEBD1111#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glUseProgram referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glUniform1i referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glUniform3fv referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glUniform4fv referenced in function "void __cdecl glnvg__setUniforms(struct GLNVGcontext *,int,int)" (?glnvg__setUniforms##YAXPEAUGLNVGcontext##HH#Z)
qnanopainter.obj : error LNK2019: unresolved external symbol glVertexAttribPointer referenced in function "void __cdecl glnvg__renderFlush(void *)" (?glnvg__renderFlush##YAXPEAX#Z)
It's not a duplicate of Unresolved external symbols - Qt creator, I run qmake after each edit of .pro file as I stated above.

Static QT unresolved external symbol

I've been trying to build using static qt for a while but i can't get rid of these errors .
<QtGuiApplication4> (29 items)
Error LNK2019: unresolved external symbol _FT_New_Face referenced in function "public: static class QStringList __cdecl QBasicFontDatabase::addTTFile(class QByteArray const &,class QByteArray const &)" (?addTTFile#QBasicFontDatabase##SA?AVQStringList##ABVQByteArray##0#Z)
Error LNK2019: unresolved external symbol _FT_Get_PS_Font_Info referenced in function "public: bool __thiscall QFontEngineFT::init(struct QFontEngine::FaceId,bool,enum QFontEngine::GlyphFormat,class QFreetypeFace *)" (?init#QFontEngineFT##QAE_NUFaceId#QFontEngine##_NW4GlyphFormat#3#PAVQFreetypeFace###Z)
Error LNK2019: unresolved external symbol _FT_Load_Sfnt_Table referenced in function "bool __cdecl ft_getSfntTable(void *,unsigned int,unsigned char *,unsigned int *)" (?ft_getSfntTable##YA_NPAXIPAEPAI#Z)
Error LNK2019: unresolved external symbol _FT_GlyphSlot_Oblique referenced in function "public: virtual void __thiscall QFontEngineFT::addGlyphsToPath(unsigned int *,struct QFixedPoint *,int,class QPainterPath *,class QFlags<enum QTextItem::RenderFlag>)" (?addGlyphsToPath#QFontEngineFT##UAEXPAIPAUQFixedPoint##HPAVQPainterPath##V?$QFlags#W4RenderFlag#QTextItem#####Z)
Error LNK2019: unresolved external symbol _FT_GlyphSlot_Embolden referenced in function "public: virtual void __thiscall QFontEngineFT::addGlyphsToPath(unsigned int *,struct QFixedPoint *,int,class QPainterPath *,class QFlags<enum QTextItem::RenderFlag>)" (?addGlyphsToPath#QFontEngineFT##UAEXPAIPAUQFixedPoint##HPAVQPainterPath##V?$QFlags#W4RenderFlag#QTextItem#####Z)
Error LNK2019: unresolved external symbol _FT_Outline_Get_Bitmap referenced in function "public: struct QFontEngineFT::Glyph * __thiscall QFontEngineFT::loadGlyph(struct QFontEngineFT::QGlyphSet *,unsigned int,struct QFixed,enum QFontEngine::GlyphFormat,bool)const " (?loadGlyph#QFontEngineFT##QBEPAUGlyph#1#PAUQGlyphSet#1#IUQFixed##W4GlyphFormat#QFontEngine##_N#Z)
Error LNK2019: unresolved external symbol _FT_Outline_Transform referenced in function "public: struct QFontEngineFT::Glyph * __thiscall QFontEngineFT::loadGlyph(struct QFontEngineFT::QGlyphSet *,unsigned int,struct QFixed,enum QFontEngine::GlyphFormat,bool)const " (?loadGlyph#QFontEngineFT##QBEPAUGlyph#1#PAUQGlyphSet#1#IUQFixed##W4GlyphFormat#QFontEngine##_N#Z)
Error LNK2019: unresolved external symbol _FT_Outline_Translate referenced in function "public: struct QFontEngineFT::Glyph * __thiscall QFontEngineFT::loadGlyph(struct QFontEngineFT::QGlyphSet *,unsigned int,struct QFixed,enum QFontEngine::GlyphFormat,bool)const " (?loadGlyph#QFontEngineFT##QBEPAUGlyph#1#PAUQGlyphSet#1#IUQFixed##W4GlyphFormat#QFontEngine##_N#Z)
Error LNK2019: unresolved external symbol _FT_Vector_Transform referenced in function "public: struct QFontEngineFT::Glyph * __thiscall QFontEngineFT::loadGlyph(struct QFontEngineFT::QGlyphSet *,unsigned int,struct QFixed,enum QFontEngine::GlyphFormat,bool)const " (?loadGlyph#QFontEngineFT##QBEPAUGlyph#1#PAUQGlyphSet#1#IUQFixed##W4GlyphFormat#QFontEngine##_N#Z)
Error LNK2019: unresolved external symbol _FT_MulFix referenced in function "public: bool __thiscall QFontEngineFT::init(struct QFontEngine::FaceId,bool,enum QFontEngine::GlyphFormat,class QFreetypeFace *)" (?init#QFontEngineFT##QAE_NUFaceId#QFontEngine##_NW4GlyphFormat#3#PAVQFreetypeFace###Z)
Error LNK2019: unresolved external symbol _FT_MulDiv referenced in function "void __cdecl scaleOutline(struct FT_FaceRec_ *,struct FT_GlyphSlotRec_ *,long,long)" (?scaleOutline##YAXPAUFT_FaceRec_##PAUFT_GlyphSlotRec_##JJ#Z)
Error LNK2019: unresolved external symbol _FT_Get_Char_Index referenced in function "public: virtual unsigned int __thiscall QFontEngineFT::glyphIndex(unsigned int)const " (?glyphIndex#QFontEngineFT##UBEII#Z)
Error LNK2019: unresolved external symbol _FT_Set_Charmap referenced in function "public: static class QFreetypeFace * __cdecl QFreetypeFace::getFace(struct QFontEngine::FaceId const &,class QByteArray const &)" (?getFace#QFreetypeFace##SAPAV1#ABUFaceId#QFontEngine##ABVQByteArray###Z)
Error LNK2019: unresolved external symbol _FT_Matrix_Multiply referenced in function "public: struct QFontEngineFT::Glyph * __thiscall QFontEngineFT::loadGlyph(struct QFontEngineFT::QGlyphSet *,unsigned int,struct QFixed,enum QFontEngine::GlyphFormat,bool)const " (?loadGlyph#QFontEngineFT##QBEPAUGlyph#1#PAUQGlyphSet#1#IUQFixed##W4GlyphFormat#QFontEngine##_N#Z)
Error LNK2019: unresolved external symbol _FT_Get_Postscript_Name referenced in function "public: struct QFontEngine::Properties __thiscall QFreetypeFace::properties(void)const " (?properties#QFreetypeFace##QBE?AUProperties#QFontEngine##XZ)
Error LNK2019: unresolved external symbol _FT_Load_Glyph referenced in function "public: virtual void __thiscall QFontEngineFT::addGlyphsToPath(unsigned int *,struct QFixedPoint *,int,class QPainterPath *,class QFlags<enum QTextItem::RenderFlag>)" (?addGlyphsToPath#QFontEngineFT##UAEXPAIPAUQFixedPoint##HPAVQPainterPath##V?$QFlags#W4RenderFlag#QTextItem#####Z)
Error LNK2019: unresolved external symbol _FT_Set_Char_Size referenced in function "public: static class QFreetypeFace * __cdecl QFreetypeFace::getFace(struct QFontEngine::FaceId const &,class QByteArray const &)" (?getFace#QFreetypeFace##SAPAV1#ABUFaceId#QFontEngine##ABVQByteArray###Z)
Error LNK2019: unresolved external symbol _FT_Select_Size referenced in function "public: void __thiscall QFreetypeFace::computeSize(struct QFontDef const &,int *,int *,bool *)" (?computeSize#QFreetypeFace##QAEXABUQFontDef##PAH1PA_N#Z)
Error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "public: __thiscall QtFreetypeData::~QtFreetypeData(void)" (??1QtFreetypeData##QAE#XZ)
Error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "public: static class QFreetypeFace * __cdecl QFreetypeFace::getFace(struct QFontEngine::FaceId const &,class QByteArray const &)" (?getFace#QFreetypeFace##SAPAV1#ABUFaceId#QFontEngine##ABVQByteArray###Z)
Error LNK2001: unresolved external symbol _FT_Get_Sfnt_Table
Error LNK2019: unresolved external symbol _FT_Get_Sfnt_Table referenced in function "public: static class QStringList __cdecl QBasicFontDatabase::addTTFile(class QByteArray const &,class QByteArray const &)" (?addTTFile#QBasicFontDatabase##SA?AVQStringList##ABVQByteArray##0#Z)
Error LNK2001: unresolved external symbol _FT_Done_Face
Error LNK2019: unresolved external symbol _FT_Done_Face referenced in function "public: static class QStringList __cdecl QBasicFontDatabase::addTTFile(class QByteArray const &,class QByteArray const &)" (?addTTFile#QBasicFontDatabase##SA?AVQStringList##ABVQByteArray##0#Z)
Error LNK2001: unresolved external symbol _FT_New_Memory_Face
Error LNK2019: unresolved external symbol _FT_New_Memory_Face referenced in function "public: static class QStringList __cdecl QBasicFontDatabase::addTTFile(class QByteArray const &,class QByteArray const &)" (?addTTFile#QBasicFontDatabase##SA?AVQStringList##ABVQByteArray##0#Z)
Error LNK2001: unresolved external symbol _FT_New_Face
Error LNK2019: unresolved external symbol _FT_Set_Transform referenced in function "public: virtual void __thiscall QFontEngineFT::getUnscaledGlyph(unsigned int,class QPainterPath *,struct glyph_metrics_t *)" (?getUnscaledGlyph#QFontEngineFT##UAEXIPAVQPainterPath##PAUglyph_metrics_t###Z)
Error LNK1120: 24 unresolved externals
I am using these libraries :
ws2_32.lib
imm32.lib
winmm.lib
qtharfbuzzng.lib
qtpcre.lib
Qt5PlatformSupport.lib
qwindows.lib
opengl32.lib
Can any of you explain me what i am doing wrong ? Thank you.
I've had the exact same issue. You're missing the freetype library qtfreetype.lib.
Add the following line to your .pro file
LIBS += -lqtfreetype
You need QtCore and QtGui at a minimum for this. QString is in QtCore and QGuiApplication is in QtGui. If your Qt usage is restricted to user interface activities, that might be enough. Otherwise, for each class that's failing to link, look in Qt Assistant. The "qmake" note at the top of the page says which library contains that class.
For instance, for Qstring, it has "qmake: QT += core". For Visual Studio on Windows, the actual filenames for the "core" library are Qt5Core.dll (release) Qt5Cored.dll (debug).
Added my case, hope this will helpful.
I'm lost one CPP file in the library project
Be careful when compilation (Lib & Project) has different option MT/MD options

Using FFMPEG in a Visual Studio 2013 ultimate project, linking error LNK2019

I'm trying to use FFmpeg library and TIFF lib in my project (I'm making a .dll and/or .exe also). I have searched through the answers provided in here and Google, and linked the /dev/include 64-bit (32-bit VS making 64-bit project) to Additional Include Directories and shared/bin (library files) 64-bit to linker->Additional Library Directories and did the Linker->Additional Depedencies->avformat.lib addition. I also copied the .dll files to my project folder, but I still keep getting the LNK2019. Here's how I use the libs and the output of the compiler:
extern "C" {
#ifndef inline
#define inline __inline
#endif
#ifndef UINT64_C
#define UINT64_C uint64_t
#define INT64_C int64_t
#endif
#include <libavcodec\avcodec.h>
#include <libavformat\avformat.h>
#include <libswscale\swscale.h>
}
#pragma comment(lib, "avformat.lib")
1>------ Build started: Project: GHSOM_V3, Configuration: FFmpeg x64 ------
1> ffmpeg_io.cpp
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_malloc referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture##YAPEAUAVFrame##W4AVPixelFormat##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_free referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture##YAPEAUAVFrame##W4AVPixelFormat##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_freep referenced in function "void __cdecl aviCloseWriter(struct tagAVIWriter *)" (?aviCloseWriter##YAXPEAUtagAVIWriter###Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_rescale_q referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame##YAXPEAUtagAVIWriter##PEAE#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_frame_alloc referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture##YAPEAUAVFrame##W4AVPixelFormat##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_open2 referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create##YAXPEAUtagAVIWriter##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_close referenced in function "void __cdecl aviCloseReader(struct tagAVIReader *)" (?aviCloseReader##YAXPEAUtagAVIReader###Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_init_packet referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame##YAXPEAUtagAVIWriter##PEAE#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_free_packet referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame##YAXPEAUtagAVIReader##PEAEH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_decoder referenced in function "void __cdecl initiate_avi_open(struct tagAVIReader *)" (?initiate_avi_open##YAXPEAUtagAVIReader###Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_decode_video2 referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame##YAXPEAUtagAVIReader##PEAEH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_encoder referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create##YAXPEAUtagAVIWriter##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_encoder_by_name referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create##YAXPEAUtagAVIWriter##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_encode_video referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame##YAXPEAUtagAVIWriter##PEAE#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avpicture_fill referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture##YAPEAUAVFrame##W4AVPixelFormat##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avpicture_get_size referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture##YAPEAUAVFrame##W4AVPixelFormat##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol sws_getContext referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create##YAXPEAUtagAVIWriter##HH#Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol sws_scale referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame##YAXPEAUtagAVIReader##PEAEH#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFClose referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA##YAXPEADPEAH1PEAE#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFGetField referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA##YAXPEADPEAH1PEAE#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFSetField referenced in function "void __cdecl tiffWriteRGBA(char *,int,int,unsigned char *)" (?tiffWriteRGBA##YAXPEADHHPEAE#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFReadRGBAImage referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA##YAXPEADPEAH1PEAE#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFOpen referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA##YAXPEADPEAH1PEAE#Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFWriteEncodedStrip referenced in function "void __cdecl tiffWriteRGBA(char *,int,int,unsigned char *)" (?tiffWriteRGBA##YAXPEADHHPEAE#Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl DCT2d(double *,double *,long,long)" (?DCT2d##YAXPEAN0JJ#Z) referenced in function "void __cdecl ForwardDCT(class DataShuffle *,unsigned char *,char *,int,int,int,int,int,bool)" (?ForwardDCT##YAXPEAVDataShuffle##PEAEPEADHHHHH_N#Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl IDCT2d(double *,double *,long,long)" (?IDCT2d##YAXPEAN0JJ#Z) referenced in function "void __cdecl ExportVideoFromDCT(class DataShuffle *,char *,char *,int,int,int,int)" (?ExportVideoFromDCT##YAXPEAVDataShuffle##PEAD1HHHH#Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl CopyToZigZag(double *,double *,long,long,long)" (?CopyToZigZag##YAXPEAN0JJJ#Z) referenced in function "void __cdecl ForwardDCT(class DataShuffle *,unsigned char *,char *,int,int,int,int,int,bool)" (?ForwardDCT##YAXPEAVDataShuffle##PEAEPEADHHHHH_N#Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl CopyFromZigZag(double *,double *,long,long,long)" (?CopyFromZigZag##YAXPEAN0JJJ#Z) referenced in function "void __cdecl ExportVideoFromDCT(class DataShuffle *,char *,char *,int,int,int,int)" (?ExportVideoFromDCT##YAXPEAVDataShuffle##PEAD1HHHH#Z)
You have to link other FFmpeg libraries as well (avcodec, avutil, etc). Same for libtiff.

Mergevec.obj: 10 unresolved linking errors (OpenCV samples collection for haartraining)

Using this tutorial, I'm trying to merge the different vectors that were created using opencv_createsamples so that I can do some haartraining.
I'm compiling mergevec.cpp using the VS 2010 command line interface:
cl /EHsc mergevec.cpp
But I get 10 unresolved externals errors, here:
/out:mergevec.exe
mergevec.obj
mergevec.obj : error LNK2019: unresolved external symbol _cvFree_ referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvReleaseMat referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int*,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvShowImage referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol "void __cdecl icvWriteVecSample(struct _iobuf *,void *)" (?icvWriteVecSample##YAXPAU_iobuf##PAX#Z) referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol "int __cdecl icvGetHaar
TraininDataFromVecCallback(struct CvMat *,void *)" (?icvGetHaarTraininDataFromVecCallback##YAHPAUCvMat##PAX#Z) referenced in function "void __cdecl icvAppendVec (struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvV
ecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvCreateMat referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvAlloc referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *, int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol _cvNamedWindow referenced in function "void __cdecl icvAppendVec(struct CvVecFile &,struct CvVecFile &,int *,int,int)" (?icvAppendVec##YAXAAUCvVecFile##0PAHHH#Z)
mergevec.obj : error LNK2019: unresolved external symbol "void __cdecl icvWriteV
ecHeader(struct _iobuf *,int,int,int)" (?icvWriteVecHeader##YAXPAU_iobuf##HHH#Z) referenced in function "void __cdecl icvMergeVecs(char *,char const *,int,int,int)" (?icvMergeVecs##YAXPADPBDHHH#Z)
mergevec.exe : fatal error LNK1120: 10 unresolved externals
How can I fix these problems? Do I need to get some .dlls?
I've been struggling with getting mergevec to work, on different machines, for 2 days! Is the problem that this is old?
By the way, I changed all references in the code from "cv.h" to "opencv.h", since that's the current header file's name.
I'm trying to compile mergevec.cpp in a folder with the following structure:
opencv/
opencv2/
CMakeLists.txt
createsamples.cpp
cvboost.cpp
cvclassifier.h
cvcommon.cpp
cvhaarclassifier.cpp
cvhaartraining.cpp
cvhaartraining.h
cvsamples.cpp
cxcore.h
cxmisc.h
haartraining.cpp
mergevec.cpp
opencv.hpp
performance.cpp
_cvcommon.h
_cvhaartraining.h
The folder opencv2 has directories: core, highgui, flann, contrib etc etc.
Edit
Based on your comments, I've changed the command to include the libraries:
cl /EHsc mergevec.cpp
C:\opencv\build\x64\vc10\lib\opencv_core247d.lib
C:\opencv\build\x64\vc10\lib\opencv_highgui247d.lib
C:\opencv\build\x64\vc10\lib\opencv_flann247d.lib
C:\opencv\build\x64\vc10\lib\opencv_imgproc247d.lib
But it's still showing the same 10 unresolved externals. In desperation I even tried including every single library file, but no difference.
Visual Studio doesn't seems to find the OpenCV library, it seems like a pkg-config missing problem. Check for this as i am not sure how it works on windows. Do you have linked the OpenCV library in your project properties?
Otherwise if it still doesn't work on VS i suggest you to compile it under Linux (WM or not). Check this post for further informations.