0

For some reason, whenever I try to use sample code my compiler refuses to cooperate.

The sample code I am using comes from here: http://qt-project.org/doc/qt-4.8/multimedia-videowidget.html ; I have currently only used the VideoWidgetSurface class.

As far as I can tell, my code is 100% the same as the sample's, and I have no coding mistakes.

However, upon compiling I receive:

1>moc_VideoWidgetSurface.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)       
public: virtual void * __thiscall QAbstractVideoSurface::qt_metacast(char const *)" (__imp_?
qt_metacast@QAbstractVideoSurface@@UAEPAXPBD@Z) referenced in function "public: virtual void * 
__thiscall VideoWidgetSurface::qt_metacast(char const *)" (?
qt_metacast@VideoWidgetSurface@@UAEPAXPBD@Z)
1>moc_VideoWidgetSurface.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)  
public: virtual int __thiscall QAbstractVideoSurface::qt_metacall(enum QMetaObject::Call,int,void * 
*)" (__imp_?qt_metacall@QAbstractVideoSurface@@UAEHW4Call@QMetaObject@@HPAPAX@Z) referenced in 
function "public: virtual int __thiscall VideoWidgetSurface::qt_metacall(enum 
QMetaObject::Call,int,void * *)"(?qt_metacall@VideoWidgetSurface@@UAEHW4Call@QMetaObject@@HPAPAX@Z)

. . . .

1>VideoWidgetSurface.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: 
class QSize __thiscall QVideoSurfaceFormat::frameSize(void)const " (__imp_?
frameSize@QVideoSurfaceFormat@@QBE?AVQSize@@XZ) referenced in function "public: bool __thiscall 
VideoWidgetSurface::isFormatSupported(class QVideoSurfaceFormat const &,class QVideoSurfaceFormat 
*)const " (?isFormatSupported@VideoWidgetSurface@@QBE_NABVQVideoSurfaceFormat@@PAV2@@Z)
1>VideoWidgetSurface.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: 
static enum QImage::Format __cdecl QVideoFrame::imageFormatFromPixelFormat(enum 
QVideoFrame::PixelFormat)" (__imp_?imageFormatFromPixelFormat@QVideoFrame@@SA?
AW4Format@QImage@@W4PixelFormat@1@@Z) referenced in function "public: bool __thiscall 
VideoWidgetSurface::isFormatSupported(class QVideoSurfaceFormat const &,class QVideoSurfaceFormat 
*)const " (?isFormatSupported@VideoWidgetSurface@@QBE_NABVQVideoSurfaceFormat@@PAV2@@Z)

. . . .

1>C:\Users\Owner\documents\visual studio 2010\Projects\ParticleTracker\Debug\ParticleTracker.exe : fatal error LNK1120: 30 unresolved externals

[removed errors, because there are a lot]

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I don't completely understand why I'm receiving this error. Up till now, I have had minimal issues with Qt, and have successfully run my programs (in Visual Studio '10, not using qmake).

I have double checked that I have linked to all of the possible .lib files in the Additional dependencies section, and I am not missing any.

It appears as if this error exists only for the Multimedia module.I searched for an existing Multimedia .lib but could not find any.

I have tried the following cmd command:

moc -I"%QTDIR%\include" -I"%QTDIR%\include\QtCore" -I"%QTDIR%\include\QtGui" -I"%QTDIR%\include\QtMultimedia" -omoc_VideoWidgetSurface.cpp VideoWidgetSurface.h

But it failed to work, and I still receive errors.

Any help is much appreciated. If you would like to see more of my code or my links/includes, I will share those as well. Thank you!

JT Cho
  • 263
  • 1
  • 4
  • 11

1 Answers1

0

You need to link with the multimedia module. Just like you link with qtgui4.dll, qtcore4.lib, etc., you must link with qtmultimedia4.lib. That's all.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • Welp... I don't have that! Searching in my %QTDIR%\lib folder, and all I see are the other.dll and .libs. :/ – JT Cho Jun 27 '12 at 00:55
  • Haha yeah, I'm doing a re-download and re-build of Qt. That should fix all my problems ^u^ – JT Cho Jun 27 '12 at 01:38