[linux-programlama] Re: Qt derleme sorunu

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: serbulent unsal (serbulent_u@yahoo.com)
Date: Tue 14 Sep 2004 - 18:27:14 EEST


Merhaba,

Tüm cevaplar için teşekkür ederim.
İnternette konu ile ilgili şöyle bir belge
buldum ve babelfish e ingilizceye çevirttim. biraz
uzun ama...

**********************************************************************************
eL_Shaman ___
Posted the 21-06-2003 to 02:44:07 profile edit
answer config MP
 
It is the first tutoriel on the site of Trolltech and
I arive not to even compile it on my Debian SID
:sweat:
http://doc.trolltech.com/3.1/tutorial1-01.html
 
 
The code:
Code:

   1.
   2.
/****************************************************************
   3. **
   4. ** Qt tutorial 1
   5. **
   6.
****************************************************************/
   7.
   8. # include < qapplication.h >
   9. # include < qpushbutton.h >
  10.
  11.
  12. int main( int argc, tank ** argv)
  13. {
  14. QApplication a(argc, argv);
  15.
  16. QPushButton hello("Hello world!", 0);
  17. hello.resize(100, 30);
  18.
  19. a.setMainWidget(&hello);
  20. hello.show();
  21. return a.exec();
  22. }
23.

 
 
I recorded it in the file main.cpp.
To compile it, I make:

qmake - project
qmake
make

 
And it is the drama, I obtain celà with the make:

g++ - C - pipe - Wall - W - O2 - DQT_NO_DEBUG -
I/usr/share/qt3/mkspecs/default - I - I - I/include -
O main.o main.cpp
main.cpp:7:26: qapplication.h: No file or repertory of
this type
main.cpp:8:25: qpushbutton.h: No file or repertory of
this type
main.cpp: In function "int main(int, tank **)":
main.cpp:13: error: ` QApplication' undeclared (first
uses this function)
main.cpp:13: error: (Each undeclared to identify is
reported only ounce for each
   function it appears in.)
main.cpp:13: error: syntactic error of analysis before
` (' token
main.cpp:15: error: ` QPushButton' undeclared (first
uses this function)
main.cpp:16: error: ` hello' undeclared (first uses
this function)
main.cpp:18: error: ` a' undeclared (first uses this
function)
main.cpp:12: caution: unused parameter ` int argc'
main.cpp:12: caution: unused parameter ` char**argv'
make: *** [ main.o ] Error 1

 
 
Then, I tried to write that for the include:
Code:

   1.
   2. # include < qt3/qapplication.h >
   3. # include < qt3/qpushbutton.h >
4.

since the headers of Qt are in /usr/include/qt3/.
 
After having remakes the qmake like front, I obtain
with the make this:

g++ - C - pipe - Wall - W - O2 - DQT_NO_DEBUG -
I/usr/share/qt3/mkspecs/default - I - I - I/include -
O main.o main.cpp
In the file included starting from
/usr/include/qt3/qobjectdefs.h:42,
          starting from
/usr/include/qt3/qwindowdefs.h:43,
          starting from /usr/include/qt3/qwidget.h:42,
          starting from
/usr/include/qt3/qdesktopwidget.h:40,
          starting from
/usr/include/qt3/qapplication.h:42,
          starting from main.cpp:7:
/usr/include/qt3/qglobal.h:710:21: qconfig.h: No file
or repertory of this type
/usr/include/qt3/qglobal.h:773:23: qfeatures.h: No
file or repertory of this type
make: *** [ main.o ] Error 1

 
I was to see, and I have well qconfig.h and
qfeatures.h (as well as the others) in
/usr/include/qt3/ thus they are there!
 
 
It is balot to stop at the first stage of a tutoriel
: (
I never connaitrais Qt : /

-- Message published by eL_Shaman ___ the 21-06-2003
to 02:46:14 --
n°281165
kadreg
Posted the 21-06-2003 to 08:47:16 profile edit
answer ICQ homepage config MP
 
Before compiling, slap:
 
QTDIR=/usr/share/qt/ export
QMAKESPEC=linux-g++ export

-- done --
n°281277
eL_Shaman ___
Posted the 21-06-2003 to 14:42:13 profile edit
answer config MP
 

QTDIR=/usr/share/qt/ export
QMAKESPEC=linux-g++ export
qmake - project
qmake
make
make: *** No rule to manufacture the target
"/usr/share/qt/3/mkspecs/linux-g++/qmake.conf",
necessary for "Makefile". Stop.

 
That does not function : /
 
But I saw that I had a file /usr/share/qt3/ with all
the file quoted above.
 
Then another attempt:

QTDIR=/usr/share/qt3/ export
QMAKESPEC=linux-g++ export
qmake - project
qmake
make
g++ - C - pipe - Wall - W - O2 - DQT_NO_DEBUG -
I/usr/share/qt3//mkspecs/linux-g++ - I - I -
I/usr/share/qt3//include - O main.o main.cpp
g++ - O HelloWorld main.o - L/usr/share/qt3//lib -
L/usr/X11R6/lib - lqt - lXext - lX11 - lm
/usr/bin/ld: - lqt cannot find
collect2: ld turned over 1 code of state of execution
make: *** [ HelloWorld ] Error 1

 
 
Ronjudju! :fou:
n°281350
lionz
Posted the 21-06-2003 to 18:52:22 profile edit
answer ICQ config MP
 
or is the relationship with debian? :heink:
n°281353
eL_Shaman ___
Posted the 21-06-2003 to 19:03:22 profile edit
answer config MP
 
Lionz wrote:

or is the relationship with debian? :heink:

 
What it is on Debian?
 
That a priori, that could function on another thing
which Debian since I am the method...
 
 
 
If you know from which the problem comes, you explain,
if not...
n°281380
Elche
Posted the 21-06-2003 to 20:10:35 profile edit
answer config MP
 
The problem it is that the linkor does not find the
lib qt. Essaye with - lqt-MT has the place of - lqt.
 
On the other hand to use qmake for only one file, it
is not very useful.
n°281576
eL_Shaman ___
Posted the 22-06-2003 to 18:44:35 profile edit
answer config MP
 
Elche wrote:

The problem it is that the linkor does not find the
lib qt. Essaye with - lqt-MT has the place of - lqt.
 
On the other hand to use qmake for only one file, it
is not very useful.

 
 
Indeed, I put that in generated Makefile and I made
export with "qt3" before and that compiled perfectly.
 
For that, I am content :)
 
 
But, it is not normal that qmake does not generate
correct Makefile.
Moreover, I tried to make a appli can in Kdevelop
which posts just a framework and what I obtained with
compilation in Kdevelop, it is that all the headers of
Qt missed : /
 
I thus amount from there wondering whether the Debian
packages do not have a problem, so certain variables
are not initialized, if the files are badly placed or
I still do not know what.

-- Message published by eL_Shaman ___ the 22-06-2003
to 18:45:07 --
n°281593
eL_Shaman ___
Posted the 22-06-2003 to 19:48:48 profile edit
answer config MP
 
I finally found a means by reading this report/ratio
of bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=180326
 
 
 
Just after having carried out "qmake - project", it is
necessary to modify the file * pro by adding the line
to it:
 
CONFIG + = thread
 
 
Then, the qmake and the make function.
 
According to what I included/understood, there are two
types of libraries for Qt3: threadées and not
threadées.
 
I use those which are threadées ("- MT" in the name of
their package), therefore I must add this parameter
bus by defect, on Debian, those used are not
threadées.

*********************************************************************

Burada yazanlar do&#287;rultusunda q.pro
dosyas&#305;na CONFIG + = thread ifadesini ekleyerek
yeniden derldim. Ama Sonuç vermedi.

Bunun üzerine i&#351;lemi ba&#351;tan alarak. Makefile
da

CXXFLAGS = -pipe -Wall -W -O2 -fomit-frame-pointer
-pipe -march=i586 -mcpu=pentiumpro -DQT_NO_DEBUG
 
K&#305;sm&#305;n&#305;

CXXFLAGS = -lqt -pipe -Wall -W -O2
-fomit-frame-pointer -pipe -march=i586
-mcpu=pentiumpro -DQT_NO_DEBUG

Ve

CXXFLAGS = -lqt-mt -pipe -Wall -W -O2
-fomit-frame-pointer -pipe -march=i586
-mcpu=pentiumpro -DQT_NO_DEBUG

&#350;eklinde iki de&#287;i&#351;ik biçimde yazarak
derledim ancak bu da sonuç vermedi.

Herhalde qt konusundaki acemili&#287;imden olacak
yukar&#305;daki belgede geçen bug reportu da tam
olarak anlayamad&#305;m.

Sonuç olarak bir&#351;eyleri yanl&#305;&#351; veya
eksik yap&#305;yorum ama neyi ?

Not: Serdar hocam gmake ile tam olarak ne yapmam
gerekti&#287;ini çözemedim çünkü zaten qmake var ve
trolltech tutorial da o kullan&#305;l&#305;yor.

ek: qmake program&#305;n&#305;n olu&#351;turdu&#287;u
makefile ve qmake -project komutunun
olu&#351;turdu&#287;u qt.pro dosyas&#305;

#############################################################################
# Makefile for building: qt
# Generated by qmake (1.06c) (Qt 3.2.3) on: Mon Sep 13
15:38:20 2004
# Project: qt.pro
# Template: app
# Command: $(QMAKE) -o Makefile qt.pro
#############################################################################

####### Compiler, tools and options

CC = gcc
CXX = g++
LEX = flex
YACC = yacc
CFLAGS = -pipe -Wall -W -O2 -fomit-frame-pointer
-pipe -march=i586 -mcpu=pentiumpro -DQT_NO_DEBUG
CXXFLAGS = -pipe -Wall -W -O2 -fomit-frame-pointer
-pipe -march=i586 -mcpu=pentiumpro -DQT_NO_DEBUG
LEXFLAGS =
YACCFLAGS= -d
INCPATH = -I/usr/lib/qt3/mkspecs/default -I. -I.
-I$(QTDIR)/include
LINK = g++
LFLAGS =
LIBS = $(SUBLIBS) -L/usr/X11R6/lib -lXext -lX11
-lm
AR = ar cqs
RANLIB =
MOC = $(QTDIR)/bin/moc
UIC = $(QTDIR)/bin/uic
QMAKE = qmake
TAR = tar -cf
GZIP = gzip -9f
COPY = cp -f
COPY_FILE= $(COPY)
COPY_DIR = $(COPY) -r
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files

HEADERS =
SOURCES = main.cpp
OBJECTS = main.o
FORMS =
UICDECLS =
UICIMPLS =
SRCMOC =
OBJMOC =
DIST = qt.pro
QMAKE_TARGET = qt
DESTDIR =
TARGET = qt

first: all
####### Implicit rules

.SUFFIXES: .c .o .cpp .cc .cxx .C

.cpp.o:
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
        $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: Makefile $(TARGET)

$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC)
$(LIBS) $(OBJCOMP)

mocables: $(SRCMOC)
uicables: $(UICDECLS) $(UICIMPLS)

$(MOC):
        ( cd $(QTDIR)/src/moc ; $(MAKE) )

Makefile: qt.pro
/usr/lib/qt3/mkspecs/default/qmake.conf
        $(QMAKE) -o Makefile qt.pro
qmake:
        @$(QMAKE) -o Makefile qt.pro

dist:
        @mkdir -p .tmp/qt && $(COPY_FILE) --parents
$(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/qt/ && (
cd `dirname .tmp/qt` && $(TAR) qt.tar qt && $(GZIP)
qt.tar ) && $(MOVE) `dirname .tmp/qt`/qt.tar.gz . &&
$(DEL_FILE) -r .tmp/qt

mocclean:

uiclean:

yaccclean:
lexclean:
clean:
        -$(DEL_FILE) $(OBJECTS)
        -$(DEL_FILE) *~ core *.core

####### Sub-libraries

distclean: clean
        -$(DEL_FILE) $(TARGET) $(TARGET)

FORCE:

####### Compile

main.o: main.cpp

####### Install

install: all

uninstall:

qt.pro

######################################################################
# Automatically generated by qmake (1.06c) Mon Sep 13
15:38:12 2004
######################################################################

TEMPLATE = app
CONFIG -= moc
INCLUDEPATH += .

# Input
SOURCES += main.cpp

                
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.