ToddAtWSU
26th December 2006, 15:51
I have an application that I have written in Qt4 and I need to downconvert it to Qt3. This is not something I want to do but it is something I have been tasked to do. Everything compiled and built when I used my makefile for Qt4 but now I get an error that says
Qt meta object compiler
moc: Invalid argument
Then it provides me with a list of the valid arguments. I went to my moc from Qt 3.3.3 that I have to build down to and I printed out the list of moc arguments and compared it to the list of arguments in Qt 4.2.1 and I see that I have the same version of moc (Version 26 Qt 3.3.3) in both of my (QTDIR)/bin directories. Why would the makefile work fine with Qt 4.2.1 but not with Qt 3.3.3 since it says I have an invalide moc argument? My compile command looks like this (everything needs to be moc'd for this library).
%.o: $(SRC)/%.cpp
$(CXX) -c $(CFLAGS) $(DEFINES) $(INCPATH) $(SRC)/$*.cpp
$(QT)/bin/moc $(DEFINES) $(INCPATH) $(INC)/$*.h -o $(OBJECTS_DIR)/moc_$*.cpp
$(CXX) -c $(CFLAGS) $(DEFINES) $(INCPATH) -o $(OBJECTS_DIR)/moc_$*.o $(OBJECTS_DIR)/moc_$.cpp
Above this compilation line is where I set all my variables and they look like (and they do use tabs but I will leave out the tabs for this post. I commented out the DEFINES because I thought this looked like a Qt 4.2.1 thing and not a Qt 3.3.3 since QT 3.3.3 only has 1 library. Is this correct?:
SRC = ../src
TARGET = libraryName.a
QT = /usr/lib64/qt-3.3
CXX = g++
CFLAGS = -m64 -pipe -g -D_REENTRANT -W
DEFINES = #-DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_STATIC
INCPATH = -I$(QT)/mkspecs/linux-g++-64 \
-I$(QT)/include \... (the rest are not Qt paths)
OBJECTS_DIR = .
LINK = $(CXX)
LFLAGS =
LIBPATH = -L$(QT)/lib \ ... (the rest are not Qt paths)
LIBS = -lqt-mt \ ... (the rest are not Qt libraries)
AR = ar cqs
QMAKE = $(QT)/bin/qmake
The build command is:
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(AR) $(TARGET) *.o
The rest of the variables seem to be unnecessary to write in. Can anybody see anything here that would cause my error for moc'ing? Thanks for any help you have and if you need anymore information please let me know what information I can provide you with.
Qt meta object compiler
moc: Invalid argument
Then it provides me with a list of the valid arguments. I went to my moc from Qt 3.3.3 that I have to build down to and I printed out the list of moc arguments and compared it to the list of arguments in Qt 4.2.1 and I see that I have the same version of moc (Version 26 Qt 3.3.3) in both of my (QTDIR)/bin directories. Why would the makefile work fine with Qt 4.2.1 but not with Qt 3.3.3 since it says I have an invalide moc argument? My compile command looks like this (everything needs to be moc'd for this library).
%.o: $(SRC)/%.cpp
$(CXX) -c $(CFLAGS) $(DEFINES) $(INCPATH) $(SRC)/$*.cpp
$(QT)/bin/moc $(DEFINES) $(INCPATH) $(INC)/$*.h -o $(OBJECTS_DIR)/moc_$*.cpp
$(CXX) -c $(CFLAGS) $(DEFINES) $(INCPATH) -o $(OBJECTS_DIR)/moc_$*.o $(OBJECTS_DIR)/moc_$.cpp
Above this compilation line is where I set all my variables and they look like (and they do use tabs but I will leave out the tabs for this post. I commented out the DEFINES because I thought this looked like a Qt 4.2.1 thing and not a Qt 3.3.3 since QT 3.3.3 only has 1 library. Is this correct?:
SRC = ../src
TARGET = libraryName.a
QT = /usr/lib64/qt-3.3
CXX = g++
CFLAGS = -m64 -pipe -g -D_REENTRANT -W
DEFINES = #-DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_STATIC
INCPATH = -I$(QT)/mkspecs/linux-g++-64 \
-I$(QT)/include \... (the rest are not Qt paths)
OBJECTS_DIR = .
LINK = $(CXX)
LFLAGS =
LIBPATH = -L$(QT)/lib \ ... (the rest are not Qt paths)
LIBS = -lqt-mt \ ... (the rest are not Qt libraries)
AR = ar cqs
QMAKE = $(QT)/bin/qmake
The build command is:
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(AR) $(TARGET) *.o
The rest of the variables seem to be unnecessary to write in. Can anybody see anything here that would cause my error for moc'ing? Thanks for any help you have and if you need anymore information please let me know what information I can provide you with.