PDA

View Full Version : cannot run!



kazal
29th June 2010, 09:51
hi, i have problem when try to run my program..this error in build issue

:-1: error: collect2: ld returned 1 exit status

this mean what? and what should i do?
thanks..

tbscope
29th June 2010, 10:14
It means that the linker could not link your program.

More information about why it's not able to link is needed to give you a good answer.
Almost always, the exact error is in the lines above the line you posted.

kazal
29th June 2010, 10:34
the program doesn't hv any error .. only its show that error.

before this i experience the same problem and solved it jus by reset the Qt programmg(or restart my pc)
but this i tried the same solution but it doesn't work this time...

so i don't any solution to run my program ....T_T

tbscope
29th June 2010, 10:43
*Sigh*

The error means exactly like I said in my first reply. It is a linker error. Why you get this, I don't know, YOU need to provide information.

What do you use to build your program? Qt Creator?
Is your program still running when you try to rebuild it?
Did you check the compile output to know where the linking fails?

If you don't do any effort in explaining the questions above, you will not get a good answer.

Nero
29th June 2010, 10:45
Are you using QtCreator? Try switching from "Build issues" panel to " Compile Output" panel and search for errors.
I often have the program already running and the linker says: cannot open output ... permission denied ...

kazal
29th June 2010, 11:09
i'm using Qt Creator...
jus now i solved earlier problem.. thanks..i look into compile output and see the problem.

in compile output:



Running build steps for project cachedtable...
Configuration unchanged, skipping QMake step.
Starting: C:/Qt/2010.03/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Documents and Settings/WISE AVIATION/Desktop/cachedtable'
C:/Qt/2010.03/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Documents and Settings/WISE AVIATION/Desktop/cachedtable'
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"..\..\..\..\Qt\2010.03\qt\include\QtCore" -I"..\..\..\..\Qt\2010.03\qt\include\QtGui" -I"..\..\..\..\Qt\2010.03\qt\include\QtSql" -I"..\..\..\..\Qt\2010.03\qt\include" -I"..\..\..\..\Qt\2010.03\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\..\Qt\2010.03\qt\mkspecs\win32-g++" -o debug\tableeditor.o tableeditor.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\cachedtable.exe debug/main.o debug/tableeditor.o debug/moc_tableeditor.o -L"c:\Qt\2010.03\qt\lib" -lmingw32 -lqtmaind -lQtSqld4 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Documents and Settings/WISE AVIATION/Desktop/cachedtable'
mingw32-make: Leaving directory `C:/Documents and Settings/WISE AVIATION/Desktop/cachedtable'
debug/moc_tableeditor.o:moc_tableeditor.cpp:(.rdata$_ZTV 11TableEditor[vtable for TableEditor]+0xbc): undefined reference to `TableEditor::changeEvent(QEvent*)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\cachedtable.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project cachedtable
When executing build step 'Make']


i delete these code and its solved my probs.. thanks..

lyuts
2nd July 2010, 10:46
Looks like source file that contains TableEditor class was not added to .pro file and as a result didn't get into Makefile.