Qmake nicht die library-Pfad für die qt

Ich nur installieren qt auf meinem slax-box,
Und ich habe versucht zu schreiben und zu kompilieren mit qmake.

Aber das problem ist das qmake nicht schreiben, es ist 'Makefile' zu include-Lqt-mt -Lqt gelinkt werden.
Ich muss zu geben, es manuell ansonsten gibt es nicht aufgelöste links sind da. Was könnte ich
tun Sie dies?Abhilfe dazu?

Qmake nicht die library-Pfad für die qt

- Und dies ist das 'Makefile' - Ausgabe durch die qmake.

#############################################################################
# Makefile for building: hello
# Generated by qmake (2.01a) (Qt 4.5.3) on: Tue Feb 2 04:04:03 2010
# Project:  hello_world.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile hello_world.pro
#############################################################################

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

CC            = gcc
CXX           = g++
DEFINES       = 
CFLAGS        = -pipe $(DEFINES)
CXXFLAGS      = -pipe $(DEFINES)
INCPATH       = -I/usr/lib/qt-3.3.8b/mkspecs/linux-g++ -I.
LINK          = g++
LFLAGS        = 
LIBS          = $(SUBLIBS)   
AR            = ar cqs
RANLIB        = 
QMAKE         = /usr/bin/qmake
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = $(COPY)
COPY_DIR      = $(COPY) -r
INSTALL_FILE  = $(COPY_FILE)
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = $(COPY_FILE)
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

SOURCES       = hello_world.cpp 
OBJECTS       = hello_world.o
DIST          = hello_world.pro
QMAKE_TARGET  = hello
DESTDIR       = 
TARGET        = hello

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

.SUFFIXES: .o .c .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):  $(OBJECTS)  
    $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: hello_world.pro  /usr/lib/qt-3.3.8b/mkspecs/linux-g++/qmake.conf 
    $(QMAKE) -unix -o Makefile hello_world.pro
qmake:  FORCE
    @$(QMAKE) -unix -o Makefile hello_world.pro

dist: 
    @$(CHK_DIR_EXISTS) .tmp/hello1.0.0 || $(MKDIR) .tmp/hello1.0.0 
    $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/hello1.0.0/ && (cd `dirname .tmp/hello1.0.0` && $(TAR) hello1.0.0.tar hello1.0.0 && $(COMPRESS) hello1.0.0.tar) && $(MOVE) `dirname .tmp/hello1.0.0`/hello1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/hello1.0.0


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


####### Sub-libraries

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


compiler_clean: 

####### Compile

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

####### Install

install:   FORCE

uninstall:   FORCE

FORCE:

Und hier ist meine .pro-Datei, die ich verwendet.

TEMPLATE=app
CONFIG+= qt warn_on release
HEADERS=
SOURCES=hello_world.cpp
TARGET=hello

Ich bereits den $QTDIR und ich denke, alles ist vorhanden.
Wo habe ich verpasst? Warum ich es manuell? Warum qmake funktioniert nicht in der ersten
Ort?

BEARBEITEN:
Dort in der Datei makefile

LIBS          = $(SUBLIBS) 

Was ich gemacht habe, es zu ändern,

LIBS          = $(SUBLIBS)  -lqt-mt

Nachdem ich geändert, funktioniert alles einwandfrei ! Das problem ist wieder , warum ich das tun
eine Sache manuell?

FÜR @Frank Osterfeld
Ich denke, ich bin mit korrigieren 'qmake', weil ,
Wenn ich getroffen, qmake --version , ich bekomme diese.

QMake version 2.01a
Using Qt version 4.5.3 in /usr/lib/qt/lib

--Vielen Dank im Voraus--

was ist das Ergebnis des Befehls qmake -query ?
Was macht Ihr Projekt-Datei Aussehen?
Post die .pro Datei. Die Qt-version möchten Sie verwenden, Qt3 oder Qt4? Sie scheinen zu laufen, ein qt3-qmake auf Qt4 .pro Datei.
Es ist definitiv eine Verwechslung zwischen Qt3 und Qt4 irgendwo. Ihre Makefile hat zahlreiche ein paar Verweise auf Qt3 Angaben machen. Auch Qt4 nicht "qt-mt" oder "qt" - Bibliothek. Mit CONFIG += qt bekommen sollten Sie den QtCore-und QtGui-Bibliotheken.
Einige andere Dinge zu versuchen: 1. Sicherzustellen, dass Ihre Qt4-bin-Verzeichnis ist, bevor Sie Ihr Qt3 Verzeichnis bin in deinem $PATH. 2. Sicherstellen, dass $QMAKESPEC Punkte, um ein Qt4-make-Spezifikation. 3. Sicherstellen, dass $QT_PLUGIN_PATH gesetzt, um auch Ihre Qt4 Verzeichnis. 4. Wenn alles andere fehlschlägt, überprüfen Sie Qt in Ihre gesamte Umgebung mit so etwas wie " env | grep-i "qt"

InformationsquelleAutor sandun dhammika | 2012-10-29

Schreibe einen Kommentar