PDA

View Full Version : eclipse and /usr/lib/crt1.o(.text+0x18): In function `_start':



babu198649
2nd January 2008, 13:17
hi

i got the following error


/usr/lib/crt1.o(.text+0x18): In function `_start':
make[1]: Leaving directory `/home/bala/workspace_qtdemo/anim_mainwindow'
: undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [anim_mainwindow] Error 1
make: *** [release] Error 2



while compiling this program in eclipse



#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
return a.exec();
}


i googled and found that if there is no main in the program then this error occurs.

i have created a seperate project and compiled the same code by copying and pasting the same ,it works fine .

so what is causing this error:confused:.

babu198649
2nd January 2008, 13:28
hi
i have found what had caused error(the .pro file)but i had not figured out why the error has occured.

the error occurs when the .pro file is like this

TEMPLATE = app
TARGET = anim_mainwindow
QT += core \
gui
HEADERS +=

SOURCES += main.cpp \

FORMS +=
RESOURCES +=
SOURCES =



there is no error when the .pro is modified like this

TEMPLATE = app
TARGET = gggggg

QT += core gui

HEADERS +=
SOURCES += main.cpp
FORMS +=
RESOURCES +=


what is the error in the former dot pro file:confused:

babu198649
2nd January 2008, 13:36
oh ..
i found the problem .in the first .pro file i have typed SOURCES instead of RESOURCES .therefore the SOURCES had been occured twice in the .pro file which had caused error.

jpn
2nd January 2008, 13:48
There's an extra "\".

babu198649
2nd January 2008, 14:23
yes thats right
that gives different error that is related with forms since forms follow the "\".
even after clearing the "\" the error still exists and it is cleared only when the spell mistakes are made right.