Hi whenever i inlcude a header, in this case <database.h> to one of my .cpp files i get this error, "error: collect2: ld returned 1 exit status", when i remove this header everything compiles fine. I have used this header within other .cpp files so why is it not working now? any help would be much appreciated!


Qt Code:
  1. Running build steps for project test...
  2. Configuration unchanged, skipping qmake step.
  3. Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
  4. mingw32-make: Entering directory `C:/Users/../../../../test-build-desktop'
  5.  
  6. C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
  7.  
  8. mingw32-make[1]: Entering directory `C:/Users/../../../../test-build-desktop'
  9.  
  10. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include\QtSql" -I"c:\Qt\2010.05\qt\include" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\test" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\userwindow.o ..\test\userwindow.cpp
  11.  
  12. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\test.exe object_script.test.Debug -L"c:\Qt\2010.05\qt\lib" -lmingw32 -lqtmaind -lQtSqld4 -lQtGuid4 -lQtCored4
  13.  
  14. mingw32-make[1]: Leaving directory `C:/Users/../../../../test-build-desktop'
  15.  
  16. mingw32-make: Leaving directory `C:/Users/../../../../test-build-desktop'
  17.  
  18. ./debug\userwindow.o:c:/Qt/2010.05/qt/include/QtCore/../../src/corelib/thread/qbasicatomic.h:73: multiple definition of `database::DSettings(int, QString, QString, QString, QString)'
  19.  
  20. ./debug\logindialog.o:c:/Qt/2010.05/qt/include/QtGui/../../src/gui/kernel/qwidget.h:487: first defined here
  21.  
  22. ./debug\userwindow.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: multiple definition of `database::DConnect()'
  23.  
  24. ./debug\logindialog.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: first defined here
  25.  
  26. collect2: ld returned 1 exit status
  27.  
  28. mingw32-make[1]: *** [debug\test.exe] Error 1
  29.  
  30. mingw32-make: *** [debug] Error 2
  31.  
  32. The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
  33. Error while building project test (target: Desktop)
  34. When executing build step 'Make'
To copy to clipboard, switch view to plain text mode 

Thanks for your time and trouble