Ich habe mit qmake -project eine Projectdatei gemacht und habe in meine Projectdatei eine Modulerweiterung eingetragen das auch die Q3 Layer mit unterstützt werden und wollte meine xab.cpp und xab.h kompilieren und habe das ausgeführt:
Code: Alles auswählen
qmake
makeCode: Alles auswählen
C:\PROGRAMMIEREN\CPP_PROJECTS\xab>make
make -f Makefile.Release
make[1]: Entering directory `C:/PROGRAMMIEREN/CPP_PROJECTS/xab'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_D
LL -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -D
QT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.1/include/QtCore" -I"C:/Qt/4.1.1
/include/QtGui" -I"C:/Qt/4.1.1/include/Qt3Support" -I"C:/Qt/4.1.1/include" -I"."
-I"C:/Qt/4.1.1/include/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.1/mkspecs/win32
-g++" -o release\xab.o xab.cpp
In file included from xab.moc:10,
from xab.cpp:10:
xab.h:15: error: redefinition of `class xab_core'
xab.h:15: error: previous definition of `class xab_core'
xab.h:49: error: redefinition of `xab_core::xab_core()'
xab.h:49: error: `xab_core::xab_core()' previously defined here
xab.h:49: confused by earlier errors, bailing out
make[1]: *** [release\xab.o] Error 1
make[1]: Leaving directory `C:/PROGRAMMIEREN/CPP_PROJECTS/xab'
make: *** [release] Error 2Ich habe diese .moc in mein release Ordner reinkopiert und per #include eingefügt und es kommt wie oben dann zu diesen Fehler. Wenn ich meine class nicht auf eine .h auslager, dann funktioniert alles reibungslos!moc xab.h -o xab.moc
Hier noch meine Projectdatei:
Code: Alles auswählen
######################################################################
# Automatically generated by qmake (2.00a) So 19. Mrz 18:20:47 2006
######################################################################
TEMPLATE = app
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
QT += qt3support
# Input
HEADERS += xab.h
SOURCES += xab.cpp