Autor Tópico: Erro no QT4  (Lida 1759 vezes)

Offline HelderC

  • Usuário Ubuntu
  • *
  • Mensagens: 227
  • helderc at IRC.Freenode
    • Ver perfil
    • HelderC
Erro no QT4
« Online: 29 de Setembro de 2008, 10:56 »
Gente, estou usando o QT4, mas chega umas partes do comando que dá erro.


Código: [Selecionar]
helder@cyberhel:~/Área de Trabalho/Nova Pasta$ qmake -project
helder@cyberhel:~/Área de Trabalho/Nova Pasta$ qmake oi.pro
helder@cyberhel:~/Área de Trabalho/Nova Pasta$ make
/usr/bin/uic-qt4 untitled.ui -o ui_untitled.h
g++ -Wl,--no-undefined -o oi     -L/usr/lib -lQtGui -lQtCore -lpthread
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: ** [oi] Erro 1

Se alguem puder ajudar eu agradeço.

Offline tfmoraes

  • Usuário Ubuntu
  • *
  • Mensagens: 441
    • Ver perfil
Re: Erro no QT4
« Resposta #1 Online: 29 de Setembro de 2008, 21:39 »
coloca o código fonte aqui, se for muito grande posta no paste bin.

Offline HelderC

  • Usuário Ubuntu
  • *
  • Mensagens: 227
  • helderc at IRC.Freenode
    • Ver perfil
    • HelderC
Re: Erro no QT4
« Resposta #2 Online: 01 de Outubro de 2008, 10:16 »
Aqui estão os códigos:


Arquivo oi.pro

Código: [Selecionar]
######################################################################
# Automatically generated by qmake (2.01a) dom set 28 15:37:23 2008
######################################################################

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qt
SOURCES += qt-prebuild.cpp

# Input
FORMS += untitled.ui


Arquivo untitled.ui

Código: [Selecionar]
<ui version="4.0" >
 <class>Dialog</class>
 <widget class="QDialog" name="Dialog" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>300</height>
   </rect>
  </property>
  <property name="windowTitle" >
   <string>Dialog</string>
  </property>
  <widget class="QDialogButtonBox" name="buttonBox" >
   <property name="geometry" >
    <rect>
     <x>30</x>
     <y>240</y>
     <width>341</width>
     <height>32</height>
    </rect>
   </property>
   <property name="orientation" >
    <enum>Qt::Horizontal</enum>
   </property>
   <property name="standardButtons" >
    <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
   </property>
  </widget>
  <widget class="QPushButton" name="btnOi" >
   <property name="geometry" >
    <rect>
     <x>150</x>
     <y>60</y>
     <width>80</width>
     <height>28</height>
    </rect>
   </property>
   <property name="text" >
    <string>oi</string>
   </property>
   <property name="flat" >
    <bool>true</bool>
   </property>
  </widget>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>buttonBox</sender>
   <signal>accepted()</signal>
   <receiver>Dialog</receiver>
   <slot>accept()</slot>
   <hints>
    <hint type="sourcelabel" >
     <x>248</x>
     <y>254</y>
    </hint>
    <hint type="destinationlabel" >
     <x>157</x>
     <y>274</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>buttonBox</sender>
   <signal>rejected()</signal>
   <receiver>Dialog</receiver>
   <slot>reject()</slot>
   <hints>
    <hint type="sourcelabel" >
     <x>316</x>
     <y>260</y>
    </hint>
    <hint type="destinationlabel" >
     <x>286</x>
     <y>274</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>


Arquivo Makefile

Código: [Selecionar]
#############################################################################
# Makefile for building: oi
# Generated by qmake (2.01a) (Qt 4.3.4) on: seg set 29 06:26:26 2008
# Project:  oi.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile oi.pro
#############################################################################

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

CC            = gcc
CXX           = g++
DEFINES       = -DQT_SHARED -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS        = -pipe -g -D_REENTRANT -Wall -W $(DEFINES)
CXXFLAGS      = -pipe -fpermissive -g -D_REENTRANT -Wall -W $(DEFINES)
INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
LINK          = g++
LFLAGS        = -Wl,--no-undefined
LIBS          = $(SUBLIBS)  -L/usr/lib -lQtGui -lQtCore -lpthread
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  = install -m 644 -p
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
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       = qt-prebuild.cpp
OBJECTS       = qt-prebuild.o
DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/debug.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
oi.pro
QMAKE_TARGET  = oi
DESTDIR       =
TARGET        = oi

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

Makefile: oi.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
/usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/debug.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf
$(QMAKE) -unix -o Makefile oi.pro
/usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/usr/share/qt4/mkspecs/features/default_pre.prf:
/usr/share/qt4/mkspecs/features/debug.prf:
/usr/share/qt4/mkspecs/features/default_post.prf:
/usr/share/qt4/mkspecs/features/qt.prf:
/usr/share/qt4/mkspecs/features/unix/thread.prf:
/usr/share/qt4/mkspecs/features/moc.prf:
/usr/share/qt4/mkspecs/features/warn_on.prf:
/usr/share/qt4/mkspecs/features/resources.prf:
/usr/share/qt4/mkspecs/features/uic.prf:
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
qmake:  FORCE
@$(QMAKE) -unix -o Makefile oi.pro

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


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


####### Sub-libraries

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


mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all:
compiler_moc_header_clean:
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_untitled.h
compiler_uic_clean:
-$(DEL_FILE) ui_untitled.h
ui_untitled.h: untitled.ui
/usr/bin/uic-qt4 untitled.ui -o ui_untitled.h

compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_uic_clean

####### Compile

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

####### Install

install:   FORCE

uninstall:   FORCE

FORCE: