Hi, folks, new to Qt. I'm working on updating an application that performs a special kind of comparison on images and my job is to integrate functionality that automates this over a whole directory. It looks like Qt's QDirIterator library is more robust and much better documented than Boost's filesystem (which I already have working), so I want to get this working in Qt, but I'm getting linker errors when compiling this in VC++ '08. This is, of course, just a trivial application to print the names of the files so I can get a feel for the library. Any insight into which libs I should include?

Qt Code:
  1. void show_files(const string &path)
  2. {
  3. QDir directory;
  4. QString str = QString::fromStdString(path);
  5. directory.setPath(str);
  6. string fileName = "",
  7. direc = directory.path().toStdString(),
  8. ext;
  9.  
  10. int num_files_seen = 0;
  11.  
  12. if ( directory.exists() )
  13. {
  14. QDirIterator i(directory);
  15.  
  16. while( i.hasNext() )
  17. {
  18. if( i.fileInfo().isDir() )
  19. direc = i.fileInfo().path().toStdString();
  20. else
  21. {
  22. fileName = i.fileInfo().fileName().toStdString();
  23. ext = i.fileInfo().suffix().toStdString();
  24. cout << fileName << " is in " << direc
  25. << " and has the file extension " << ext << endl;
  26. num_files_seen++;
  27. }
  28. }
  29. }
  30. cout << num_files_seen << " seen.\n";
  31. }
  32.  
  33.  
  34. 1>------ Build started: Project: iter, Configuration: Debug Win32 ------
  35. 1>Linking...
  36. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDir::~QDir(void)" (__imp_??1QDir@@QAE@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  37. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QDirIterator::~QDirIterator(void)" (__imp_??1QDirIterator@@UAE@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  38. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QFileInfo::suffix(void)const " (__imp_?suffix@QFileInfo@@QBE?AVQString@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  39. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QFileInfo::fileName(void)const " (__imp_?fileName@QFileInfo@@QBE?AVQString@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  40. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QFileInfo::path(void)const " (__imp_?path@QFileInfo@@QBE?AVQString@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  41. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QFileInfo::~QFileInfo(void)" (__imp_??1QFileInfo@@QAE@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  42. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QFileInfo::isDir(void)const " (__imp_?isDir@QFileInfo@@QBE_NXZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  43. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QFileInfo __thiscall QDirIterator::fileInfo(void)const " (__imp_?fileInfo@QDirIterator@@QBE?AVQFileInfo@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  44. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QDirIterator::hasNext(void)const " (__imp_?hasNext@QDirIterator@@QBE_NXZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  45. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDirIterator::QDirIterator(class QDir const &,class QFlags<enum QDirIterator::IteratorFlag>)" (__imp_??0QDirIterator@@QAE@ABVQDir@@V?$QFlags@W4IteratorFlag@QDirIterator@@@@@Z) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  46. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QDir::exists(void)const " (__imp_?exists@QDir@@QBE_NXZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  47. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QString::toStdString(void)const " (__imp_?toStdString@QString@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  48. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QDir::path(void)const " (__imp_?path@QDir@@QBE?AVQString@@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  49. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QDir::setPath(class QString const &)" (__imp_?setPath@QDir@@QAEXABVQString@@@Z) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  50. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QString::fromStdString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?fromStdString@QString@@SA?AV1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  51. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  52. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDir::QDir(class QString const &)" (__imp_??0QDir@@QAE@ABVQString@@@Z) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  53. 1>iter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(void)" (__imp_??0QString@@QAE@XZ) referenced in function "void __cdecl show_files(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?show_files@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  54. 1>C:\Users\Josh\Documents\Visual Studio 2008\Projects\/bin/iterd.exe : fatal error LNK1120: 18 unresolved externals
  55. 1>Build log was saved at "file://C:\Users\Josh\Documents\Visual Studio 2008\Projects\Build\iter\Debug\BuildLog.htm"
  56. 1>iter - 19 error(s), 0 warning(s)
  57. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
To copy to clipboard, switch view to plain text mode 

Thanks!