Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2007
qmake tutorial compilation


Message 1 in thread

Please let me know if these kinds of questions shouldn't be sent here...

I just got qt and I am doing the tutorial at
http://doc.trolltech.com/3.0/qmake-manual-4.html

I got this error at the "make" step of the qmake tutorial:

tutorial]$ make
g++ -m64 -Wl,-rpath,/usr/local/Trolltech/Qt-4.3.2/lib
-Wl,-rpath,/usr/local/Trolltech/Qt-4.3.2/lib -o hello
.obj/release-shared/hello.o    -L/home/gingorio/Desktop/qt-
x11-opensource-src-4.3.2/lib -lQtGui -L/home/gingorio/Desktop/qt-
x11-opensource-src-4.3.2/lib -L/usr/X11R6/lib64 -lpng -lSM -lICE -pthread
-L/lib64 -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama
-lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread
-lgthread-2.0-lrt -
lglib-2.0 -lpthread -ldl
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [hello] Error 1


any ideas?

Message 2 in thread

Am Sonntag, 4. November 2007 01:52:32 schrieb Gregorio Canelos:

> http://doc.trolltech.com/3.0/qmake-manual-4.html
I think you should use the appropriate qmake-manual from here:
http://doc.trolltech.com/4.3/qmake-manual.html

> I got this error at the "make" step of the qmake tutorial:

Even with the old qmake tutorial this still should work, did you wrote the 
hello.cpp main.cpp and hello.h ? (like mentioned in the "Starting off simple" 
section?) And if so did you wrote the main function?

> (.text+0x20): undefined reference to `main'

this line tells you that the linker can not find a main function, which is 
strictly needed by linux applications

Simon

--
 [ signature omitted ] 

Message 3 in thread

First of all please write your answer to the whole list not only two me, I 
have the full message attached below for all the other people to read it.

Well if you really use the code from the tutorial then you should have those 
files:
-rw-r--r-- 1 twist users  1961 Aug  7 14:09 hello.cpp
-rw-r--r-- 1 twist users  1874 Aug  7 14:09 hello.h
-rw-r--r-- 1 twist users  2000 Aug  7 14:09 main.cpp
-rw-r--r-- 1 twist users    94 Nov  4 03:41 hello.pro
while you have written hello.pro by yourself and it should look like this:

CONFIG += qt
HEADERS += hello.h
SOURCES += hello.cpp
SOURCES += main.cpp
TARGET = helloworld

if this is not the case, then this is your problem. If not then could you 
please send your hello.pro file and look if the sizes of your main.cpp 
hello.cpp and hello.h are the same as mine.

Simon

Am Sonntag, 4. November 2007 03:27:39 schrieben Sie:
> On 11/3/07, Simon Schäfer <SirTwist@xxxxxx> wrote:
> > Am Sonntag, 4. November 2007 01:52:32 schrieb Gregorio Canelos:
> > > http://doc.trolltech.com/3.0/qmake-manual-4.html
> >
> > I think you should use the appropriate qmake-manual from here:
> > http://doc.trolltech.com/4.3/qmake-manual.html
>
> thanks for your help!
> luckily this part of the tutorial says the same thing.
>
> > I got this error at the "make" step of the qmake tutorial:
> >
> > Even with the old qmake tutorial this still should work, did you wrote
> > the hello.cpp main.cpp and hello.h ? (like mentioned in the "Starting off
> > simple"
> > section?) And if so did you wrote the main function?
> >
> > > (.text+0x20): undefined reference to `main'
> >
> > this line tells you that the linker can not find a main function, which
> > is strictly needed by linux applications
>
> QT provided the source files. So, I have:
>
> ]$ ls
> hello.cpp  hello.h  hello.pro  hello.pro~  hellounix.cpp  hellowin.cpp
> main.cpp  Makefile
>
> "qmake" succeeds, but "make" doesn't succeed...
>
>
> Simon
>
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/


--
 [ signature omitted ] 

Message 4 in thread

My hello.pro said SUORCES instead of SOURCES on one of the lines.
Thanks for your help!



On 11/3/07, Simon Schäfer <SirTwist@xxxxxx> wrote:
>
> First of all please write your answer to the whole list not only two me, I
> have the full message attached below for all the other people to read it.
>
> Well if you really use the code from the tutorial then you should have
> those
> files:
> -rw-r--r-- 1 twist users  1961 Aug  7 14:09 hello.cpp
> -rw-r--r-- 1 twist users  1874 Aug  7 14:09 hello.h
> -rw-r--r-- 1 twist users  2000 Aug  7 14:09 main.cpp
> -rw-r--r-- 1 twist users    94 Nov  4 03:41 hello.pro
> while you have written hello.pro by yourself and it should look like this:

CONFIG += qt
> HEADERS += hello.h
> SOURCES += hello.cpp
> SOURCES += main.cpp
> TARGET = helloworld
>
> if this is not the case, then this is your problem. If not then could you
> please send your hello.pro file and look if the sizes of your main.cpp
> hello.cpp and hello.h are the same as mine.

Simon
>
> Am Sonntag, 4. November 2007 03:27:39 schrieben Sie:
> > On 11/3/07, Simon Schäfer <SirTwist@xxxxxx> wrote:
> > > Am Sonntag, 4. November 2007 01:52:32 schrieb Gregorio Canelos:
> > > > http://doc.trolltech.com/3.0/qmake-manual-4.html
> > >
> > > I think you should use the appropriate qmake-manual from here:
> > > http://doc.trolltech.com/4.3/qmake-manual.html
> >
> > thanks for your help!
> > luckily this part of the tutorial says the same thing.
> >
> > > I got this error at the "make" step of the qmake tutorial:
> > >
> > > Even with the old qmake tutorial this still should work, did you wrote
> > > the hello.cpp main.cpp and hello.h ? (like mentioned in the "Starting
> off
> > > simple"
> > > section?) And if so did you wrote the main function?
> > >
> > > > (.text+0x20): undefined reference to `main'
> > >
> > > this line tells you that the linker can not find a main function,
> which
> > > is strictly needed by linux applications
> >
> > QT provided the source files. So, I have:
> >
> > ]$ ls
> > hello.cpp  hello.h  hello.pro  hello.pro~  hellounix.cpp  hellowin.cpp
> > main.cpp  Makefile
> >
> > "qmake" succeeds, but "make" doesn't succeed...
> >
> >
> > Simon
> >
> > > --
> > > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > > "unsubscribe" in the subject or the body.
> > > List archive and information: http://lists.trolltech.com/qt-interest/
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>