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!
Running build steps for project test...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Users/../../../../test-build-desktop'
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/../../../../test-build-desktop'
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
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
mingw32-make[1]: Leaving directory `C:/Users/../../../../test-build-desktop'
mingw32-make: Leaving directory `C:/Users/../../../../test-build-desktop'
.
/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)'
./debug\logindialog.o:c:/Qt/2010.05/qt/include/QtGui/../../src/gui/kernel/qwidget.h:487: first defined here
./debug\userwindow.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: multiple definition of `database::DConnect()'
./debug\logindialog.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\test.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project test (target: Desktop)
When executing build step 'Make'
Running build steps for project test...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Users/../../../../test-build-desktop'
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/../../../../test-build-desktop'
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
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
mingw32-make[1]: Leaving directory `C:/Users/../../../../test-build-desktop'
mingw32-make: Leaving directory `C:/Users/../../../../test-build-desktop'
./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)'
./debug\logindialog.o:c:/Qt/2010.05/qt/include/QtGui/../../src/gui/kernel/qwidget.h:487: first defined here
./debug\userwindow.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: multiple definition of `database::DConnect()'
./debug\logindialog.o:C:\Users\../../../../test-build-desktop/../test/database.h:44: first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\test.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project test (target: Desktop)
When executing build step 'Make'
To copy to clipboard, switch view to plain text mode
Thanks for your time and trouble
Bookmarks