Hi,

I've been battling this for a few days now and can't seem to crack it. I think that my problem is that my linker cannot find the C run time files. I can compile and run other test projects which link other libraries but not this one in particular. I know the dll works because I was using it last week. I have no idea what I have done to break it - although I think it might be something missing from the PATH that points to the libraries for 'GetProcAddress, FreeLibrary,Sleep and LoadLibrary'.

I have re-installed qt and noticed that it does install "Microsoft Visual C++ 2008 Redistributable". What should I have in my PATH? I currently have
C:\Qt\2009.03\bin;
C:\Qt\2009.03\qt\bin;
C:\Qt\2009.03\mingw\bin;
in there.

Here is the project file and the compiler output from my super simple Qt program and just trying to include this library. The .h and .cpp files include ok, it is just when linking the dll when the issue arises.

Thanks for any help in advance.

Qt Code:
  1. TARGET = test
  2. TEMPLATE = app
  3.  
  4.  
  5. SOURCES += main.cpp\
  6. mainwindow.cpp
  7. SOURCES += "C:/MAVSTAR/include/DatabaseInterface.cpp"
  8.  
  9. HEADERS += mainwindow.h \
  10. "C:/MAVSTAR/include/DatabaseInterface.h" \
  11. "C:/MAVSTAR/include/DatabaseStructure.h"
  12.  
  13. FORMS += mainwindow.ui
  14.  
  15. LIBS += -L"C:/MAVSTAR/lib" \
  16. -ldblib
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x15f): undefined reference to `SetUnhandledExceptionFilter@4'
  2. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x256): undefined reference to `ExitProcess@4'
  3. debug/mainwindow.o: In function `ZThn8_N10MainWindowD0Ev':
  4. C:/Documents and Settings/Derek/Desktop/test/mainwindow.cpp:(.text$_ZN15QBasicAtomicInt5derefEv[QBasicAtomicInt::deref()]+0xd): undefined reference to `_imp__InterlockedDecrement@4'
  5. debug/DatabaseInterface.o: In function `Z29GetFunctionPointerToEntyPointPcPPFvvE':
  6. C:/Documents and Settings/Derek/Desktop/test/../../../../MAVSTAR/include/DatabaseInterface.cpp:18: undefined reference to `GetProcAddress@8'
  7. debug/DatabaseInterface.o: In function `Z17By_DB_DLL_Libraryv':
  8. C:/Documents and Settings/Derek/Desktop/test/../../../../MAVSTAR/include/DatabaseInterface.cpp:25: undefined reference to `FreeLibrary@4'
  9. debug/DatabaseInterface.o: In function `Z21InitPointersToDLL_LIBv':
  10. C:/Documents and Settings/Derek/Desktop/test/../../../../MAVSTAR/include/DatabaseInterface.cpp:30: undefined reference to `LoadLibraryW@4'
  11. debug/DatabaseInterface.o: In function `Z7MySleepi':
  12. C:/Documents and Settings/Derek/Desktop/test/../../../../MAVSTAR/include/DatabaseInterface.cpp:49: undefined reference to `Sleep@4'
  13. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0x1a): undefined reference to `GetCommandLineA@0'
  14. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0x27): undefined reference to `GetStartupInfoA@4'
  15. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0xdc): undefined reference to `GetModuleHandleA@4'
  16. c:/Qt/2009.03/qt/lib/libqtmaind.a(qtmain_win.o): In function `WinMain':
  17. C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.5.0/qt/src/winmain/qtmain_win.cpp:93: undefined reference to `GetCommandLineW@0'
  18. C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.5.0/qt/src/winmain/qtmain_win.cpp:93: undefined reference to `GetCommandLineA@0'
  19. c:/Qt/2009.03/qt/lib/libqtmaind.a(qtmain_win.o): In function `ZN7QVectorIPcE13detach_helperEv':
  20. C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.5.0/qt/src/winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:(.text$_ZN15QBasicAtomicInt3refEv[QBasicAtomicInt::ref()]+0xd): undefined reference to `InterlockedIncrement@4'
  21. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(w32-shared-ptr.o):(.text+0x31): undefined reference to `_imp__GetAtomNameA@12'
  22. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(w32-shared-ptr.o):(.text+0x159): undefined reference to `_imp__FindAtomA@4'
  23. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(w32-shared-ptr.o):(.text+0x2b1): undefined reference to `_imp__AddAtomA@4'
  24. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(w32-shared-ptr.o):(.text+0x2d2): undefined reference to `_imp__FindAtomA@4'
  25. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0xf): undefined reference to `_imp__TlsAlloc@0'
  26. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x42): undefined reference to `_imp__GetLastError@0'
  27. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0xc0): undefined reference to `InterlockedIncrement@4'
  28. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0xe9): undefined reference to `imp(long,...)(...)( *) static@4'
  29. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x195): undefined reference to `_imp__GetLastError@0'
  30. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x1a0): undefined reference to `_imp__TlsGetValue@4'
  31. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x1ae): undefined reference to `_imp__SetLastError@4'
  32. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x1c8): undefined reference to `_imp__TlsSetValue@8'
  33. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x1e2): undefined reference to `_imp__GetLastError@0'
  34. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x26c): undefined reference to `_imp__TlsSetValue@8'
  35. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x279): undefined reference to `_imp__GetLastError@0'
  36. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x4a5): undefined reference to `_imp__GetLastError@0'
  37. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x4b0): undefined reference to `_imp__TlsGetValue@4'
  38. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x4be): undefined reference to `_imp__SetLastError@4'
  39. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x55b): undefined reference to `_imp__TlsSetValue@8'
  40. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x568): undefined reference to `_imp__GetLastError@0'
  41. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x715): undefined reference to `_imp__GetLastError@0'
  42. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x720): undefined reference to `_imp__TlsGetValue@4'
  43. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x72e): undefined reference to `_imp__SetLastError@4'
  44. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x79a): undefined reference to `_imp__TlsSetValue@8'
  45. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(unwind-sjlj.o):(.text+0x7a7): undefined reference to `_imp__GetLastError@0'
  46. ...
  47. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0xee): undefined reference to `_imp__TlsFree@4'
  48. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x102): undefined reference to `_imp__GetLastError@0'
  49. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x11e): undefined reference to `_imp__GetLastError@0'
  50. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x12c): undefined reference to `_imp__TlsGetValue@4'
  51. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x13a): undefined reference to `_imp__SetLastError@4'
  52. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x165): undefined reference to `_imp__TlsSetValue@8'
  53. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x178): undefined reference to `_imp__GetLastError@0'
  54. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x1be): undefined reference to `_imp__CreateSemaphoreA@16'
  55. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x1de): undefined reference to `InterlockedIncrement@4'
  56. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x201): undefined reference to `_imp__WaitForSingleObject@8'
  57. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x210): undefined reference to `InterlockedDecrement@4'
  58. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x23e): undefined reference to `InterlockedDecrement@4'
  59. c:/Qt/2009.03/mingw/bin/../lib/gcc/mingw32/3.4.5/libgcc.a(gthr-win32.o):(.text+0x262): undefined reference to `_imp__ReleaseSemaphore@12'
  60. collect2: ld returned 1 exit status
  61. mingw32-make[1]: *** [debug/test.exe] Error 1
  62. mingw32-make: *** [debug] Error 2
  63. Exited with code 2.
  64. Error while building project test
  65. When executing build step 'Make'
To copy to clipboard, switch view to plain text mode