Undefined reference to object. Possible wrong implementation - c++

I'm writing a program for a class in which I must make a card game where you must match a pair of cards. It uses a GUI written in Qt provided by the professor. I have a header file containing a class called CardDeck, which simulates a deck of cards. I have included this header file in the main .cpp file, yet whenever I try to call any member functions of this class, the compiler prints "undefined reference to `CardDeck::(member function)'". I have a .cpp file called CardDeck.cpp that defines the member functions that is in the project folder, but it may not compile right or something. I am fairly inexperienced, so I'm not sure. Any help would be appreciated. I am using MinGW compiler with NetBeans IDE.
main.cpp:
#include "CardDeck.h"
using namespace std;
// Declare any global variables (your deck object) here:
CardDeck gdeck(9, 14, 2);
void shuffleCards(){
gdeck.ShuffleDeck();
}
CardDeck.h:
#ifndef CARDDECK_H
#define CARDDECK_H
#include "PlayingCard.h"
#include <vector>
class CardDeck {
public:
CardDeck();
CardDeck(int, int, int);
void ShuffleDeck();
void DisplayXCards(int);
void DisplayContents() const;
private:
std::vector<PlayingCard> deck;
int begin;
int end;
int number_each;
};
#endif /* CARDDECK_H */
CardDeck.cpp:
#include <vector>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include "PlayingCard.h"
#include "CardDeck.h"
using namespace std;
CardDeck::CardDeck(){
begin = 2;
end = 14;
}
CardDeck::CardDeck(int b, int e, int num_each){
begin = b;
end = e;
number_each = num_each;
char shapes[4] = {'H', 'S', 'C', 'D'};
for(int k=0; k<number_each; k++){
for(int j=0; j<4; j++){
for(int i = begin; i<= end; i++){
PlayingCard pc(i, shapes[j]);
deck.push_back(pc);
}
}
}
}
void CardDeck::DisplayContents() const{
for(int k=0; k<deck.size(); k++){
cout << deck[k].DisplayName() << endl;
}
}
void CardDeck::ShuffleDeck(){
random_shuffle(deck.begin(), deck.end());
}
void CardDeck::DisplayXCards(int n){
for(int i=0; i<n; i++){
cout << deck[i].DisplayName() << endl;
}
}
Makefile:
#############################################################################
# Makefile for building: cs215pgm3
# Generated by qmake (2.01a) (Qt 4.8.0) on: Thu Mar 1 15:03:59 2012
# Project: cs215pgm3.pro
# Template: app
# Command: c:/QtSDK/Desktop/Qt/4.8.0/mingw/bin/qmake.exe QMAKE_CC=C:/QtSDK/mingw/bin/gcc.exe QMAKE_CXX=C:/QtSDK/mingw/bin/g++.exe "QMAKE_CFLAGS=-g3 -gdwarf-2" "QMAKE_CXXFLAGS=-g3 -gdwarf-2" -o Makefile cs215pgm3.pro
#############################################################################
first: debug
install: debug-install
uninstall: debug-uninstall
MAKEFILE = Makefile
QMAKE = c:/QtSDK/Desktop/Qt/4.8.0/mingw/bin/qmake.exe
DEL_FILE = rm
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp
COPY_FILE = $(COPY)
COPY_DIR = cp -r
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm
SYMLINK =
DEL_DIR = rmdir
MOVE = mv
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
SUBTARGETS = \
debug \
release
debug: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_default: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_first: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug first
debug-all: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug all
debug-clean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug clean
debug-distclean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug distclean
debug-install: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug install
debug-uninstall: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug uninstall
release: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_default: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_first: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release first
release-all: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release all
release-clean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release clean
release-distclean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release distclean
release-install: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release install
release-uninstall: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release uninstall
Makefile: cs215pgm3.pro c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default/qmake.conf c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/qconfig.pri \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/modules/qt_webkit_version.pri \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt_functions.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt_config.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/exclusive_builds.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/default_pre.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/default_pre.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/debug.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/debug_and_release.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/default_post.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/default_post.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/rtti.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/exceptions.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/stl.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/shared.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/warn_on.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/thread.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/moc.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/windows.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/resources.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/uic.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/yacc.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/lex.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/include_source_dir.prf \
c:/QtSDK/Desktop/Qt/4.8.0/mingw/lib/qtmaind.prl
$(QMAKE) QMAKE_CC=C:/QtSDK/mingw/bin/gcc.exe QMAKE_CXX=C:/QtSDK/mingw/bin/g++.exe "QMAKE_CFLAGS=-g3 -gdwarf-2" "QMAKE_CXXFLAGS=-g3 -gdwarf-2" -o Makefile cs215pgm3.pro
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/qconfig.pri:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/modules/qt_webkit_version.pri:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt_functions.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt_config.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/exclusive_builds.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/default_pre.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/default_pre.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/debug.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/debug_and_release.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/default_post.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/default_post.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/rtti.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/exceptions.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/stl.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/shared.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/warn_on.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/qt.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/thread.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/moc.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/win32/windows.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/resources.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/uic.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/yacc.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/lex.prf:
c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/features/include_source_dir.prf:
c:\QtSDK\Desktop\Qt\4.8.0\mingw\lib\qtmaind.prl:
qmake: qmake_all FORCE
#$(QMAKE) QMAKE_CC=C:/QtSDK/mingw/bin/gcc.exe QMAKE_CXX=C:/QtSDK/mingw/bin/g++.exe "QMAKE_CFLAGS=-g3 -gdwarf-2" "QMAKE_CXXFLAGS=-g3 -gdwarf-2" -o Makefile cs215pgm3.pro
qmake_all: FORCE
make_default: debug-make_default release-make_default FORCE
make_first: debug-make_first release-make_first FORCE
all: debug-all release-all FORCE
clean: debug-clean release-clean FORCE
distclean: debug-distclean release-distclean FORCE
-$(DEL_FILE) Makefile
check: first
debug-mocclean: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocclean
release-mocclean: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocclean
mocclean: debug-mocclean release-mocclean
debug-mocables: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocables
release-mocables: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocables
mocables: debug-mocables release-mocables
FORCE:
$(MAKEFILE).Debug: Makefile
$(MAKEFILE).Release: Makefile
Compiling/Error Message:
/usr/bin/make -f Makefile.Debug
make[1]: Entering directory `/c/Users/Ben/Documents/CS 215/Programs/cs215Pgm3'
C:/QtSDK/mingw/bin/g++.exe -c -g3 -gdwarf-2 -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -o debug/cardwidget.o cardwidget.cpp
C:/QtSDK/mingw/bin/g++.exe -c -g3 -gdwarf-2 -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -o debug/cardwindow.o cardwindow.cpp
C:/QtSDK/mingw/bin/g++.exe -c -g3 -gdwarf-2 -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -o debug/main.o main.cpp
C:/QtSDK/Desktop/Qt/4.8.0/mingw/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -D__GNUC__ -DWIN32 cardwindow.h -o debug/moc_cardwindow.cpp
C:/QtSDK/mingw/bin/g++.exe -c -g3 -gdwarf-2 -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -o debug/moc_cardwindow.o debug/moc_cardwindow.cpp
C:/QtSDK/Desktop/Qt/4.8.0/mingw/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -D__GNUC__ -DWIN32 cardwidget.h -o debug/moc_cardwidget.cpp
C:/QtSDK/mingw/bin/g++.exe -c -g3 -gdwarf-2 -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtCore' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/QtGui' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include' -I'.' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/include/ActiveQt' -I'debug' -I'c:/QtSDK/Desktop/Qt/4.8.0/mingw/mkspecs/default' -o debug/moc_cardwidget.o debug/moc_cardwidget.cpp
g++ -mthreads -Wl,-subsystem,windows -o debug/cs215pgm3.exe debug/cardwidget.o debug/cardwindow.o debug/cs215pgm3.o debug/main.o debug/moc_cardwindow.o debug/moc_cardwidget.o debug/qrc_cards.o -L'c:/QtSDK/Desktop/Qt/4.8.0/mingw/lib' -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
make[1]: Leaving directory `/c/Users/Ben/Documents/CS 215/Programs/cs215Pgm3'
debug/cs215pgm3.o: In function `Z12shuffleCardsv':
C:\Users\Ben\Documents\CS 215\Programs\cs215Pgm3/cs215pgm3.cpp:107: undefined reference to `CardDeck::ShuffleDeck()'
debug/cs215pgm3.o: In function `_static_initialization_and_destruction_0':
C:\Users\Ben\Documents\CS 215\Programs\cs215Pgm3/cs215pgm3.cpp:99: undefined reference to `CardDeck::CardDeck(int, int, int)'
collect2: ld returned 1 exit status
make[1]: *** [debug/cs215pgm3.exe] Error 1
make: *** [debug] Error 2
BUILD FAILED (exit value 2, total time: 9s)

Look at your compiler output the first few lines show you are compiling cardwidget.cpp, cardwindow.cpp and main.cpp. There is no corresponding line for CardDeck.cpp. (As well as what I assume are some mocked versions for unit testing). The make file you posted showed no references to these files. I am no make expert but I suspect the makefile you posted is including another file (possibly the MAKEFILE=Makefile) that you did not include. Look into your project files and see if you can find the file that is specifying the above files, typically as I remember Makefiles there should be something like
SOURCES =
or
SOURCES +=
and
HEADERS=
or
HEADERS +=
At any rate there HAS to be a reference to the source and header files by name so if you can search inside the content of files, find the one that has cardwidget.cpp and possibly cardwidget.h. Then see if you can modify that file to include CardDeck.cpp and CardDeck.h.
What you posted is so complex I suspect some file automated build tool is creating this for you and your development environment may have some other way for you to specify your new source and header files and then it updates the make files automatically. You need to read whatever documentation came with your compiler/build system. Failing that specify Exactly what build tools you are using and maybe someone experienced with those tools can help.

Related

linking include path problem in qt project makfile

I am trying to build my c++ project using this make file :
CXX=g++ -std=c++11
LD=g++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NO_VERSION_TAGGING
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -m64 -pipe -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64
QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
LINK = g++
LFLAGS = -m64 -Wl,-O1
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
LIBS= $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
INCPATH= -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64
LDFLAGS=-Wall -fPIC -Wextra -O3 -fopenmp -L/usr/X11R6/lib -lX11 -lSDL -lrt -lpthread -lXft -L/usr/local/lib/mysql -lmysqlclient -lXpm -L./ -lMyTestLicense
FREETYPE_CFLAGS=$(shell freetype-config --cflags )
FREETYPE_LDFLAGS=$(shell freetype-config --libs)
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES=$(wildcard *.cpp)
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=test
QMAKE_TARGET = test
DESTDIR =
TARGET = test
####### Build rules
$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
all:$(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(LD) $(FREETYPE_LDFLAGS) $(OBJECTS) $(LDFLAGS) -o $#
####### Compile
.cpp.o:
$(CXX) $(FREETYPE_CFLAGS) $(CXXFLAGS) $(INCPATH) -c -Wno-write-strings -g -fpermissive $< -o $#
clean:
rm -rf *o test
i did not try to create make file using qmake because of special library that i need in my own project, So i decided to write my own makefile, and this is the only class(testmain.cpp) in my source code that i use QT library in it,thi is testmain.cpp:
#include <QtWidgets>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget qWin;
QGridLayout qGrid;
qGrid.addWidget(new QLabel("UTF-8:"), 1, 0);
QByteArray string = "شهاب حسینی";
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
QString encodedString = codec->toUnicode(string);
qGrid.addWidget(new QLabel(encodedString), 1, 1);
qWin.setLayout(&qGrid);
qWin.show();
return app.exec();
}
but when I try to make my project ,executable test will not produce and i face with this errors which part of my make file is wrong ?
> In function `QTypedArrayData<char>::deallocate(QArrayData*)':
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:222: undefined
> reference to `QArrayData::deallocate(QArrayData*, unsigned long,
> unsigned long)' testmain.o: In function `QTypedArrayData<unsigned
> short>::deallocate(QArrayData*)':
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:222: undefined
> reference to `QArrayData::deallocate(QArrayData*, unsigned long,
> unsigned long)'

ld: symbol(s) not found for architecture x86_64 qt

I'm trying to compile a basic Qt program:
#include <iostream>
#include <QApplication>
int main(int argc, char** argv) {
QApplication app(argc, argv);
std::cout << "test" << std::endl;
}
To start a Qt-project I did the following:
Make a project.pro file:
TEMPLATE += app
QT += widgets gui
SOURCES += main.cpp
Run the qmake command.
Edit the following in the generated Makefile:
-mmacosx-version-min=10.15.3 in CXXFLAGS
remove the -c argument from the compiler
Than I ran make and got the following error output:
/Library/Developer/CommandLineTools/usr/bin/clang++ -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.15.3 -Wall -Wextra -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt/5.14.1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt/5.14.1/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.14.1/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.14.1/lib -o main.o main.cpp
Undefined symbols for architecture x86_64:
"QApplication::QApplication(int&, char**, int)", referenced from:
_main in main-96fd09.o
"QApplication::~QApplication()", referenced from:
_main in main-96fd09.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [main.o] Error 1
I might have an idea what is causing this, when running make -v I get this output:
This program built for i386-apple-darwin11.3.0
clang++ --version generates this output:
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
I think the Makefile is trying to compile my code for an older architecture and that's generating a conflict but I'm not sure. My system is a Macbook Pro running MacOS Catalina 10.15.3. Qt is version 15.4.1. Qmake is version 3.1.
Full Makefile:
#############################################################################
# Makefile for building: test.app/Contents/MacOS/test
# Generated by qmake (3.1) (Qt 5.14.1)
# Project: test.pro
# Template: app
# Command: /usr/local/Cellar/qt/5.14.1/bin/qmake -o Makefile test.pro
#############################################################################
MAKEFILE = Makefile
EQ = =
####### Compiler, tools and options
CC = /Library/Developer/CommandLineTools/usr/bin/clang
CXX = /Library/Developer/CommandLineTools/usr/bin/clang++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -pipe -O2 $(EXPORT_ARCH_ARGS) -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC $(DEFINES)
CXXFLAGS = -pipe -stdlib=libc++ -O2 -std=gnu++11 $(EXPORT_ARCH_ARGS) -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.15.3 -Wall -Wextra -fPIC $(DEFINES)
INCPATH = -I. -I/usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt/5.14.1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt/5.14.1/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.14.1/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.14.1/lib
QMAKE = /usr/local/Cellar/qt/5.14.1/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
QINSTALL = /usr/local/Cellar/qt/5.14.1/bin/qmake -install qinstall
QINSTALL_PROGRAM = /usr/local/Cellar/qt/5.14.1/bin/qmake -install qinstall -exe
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = test1.0.0
DISTDIR = /Users/myName/School/C++/QtTest/.tmp/test1.0.0
LINK = /Library/Developer/CommandLineTools/usr/bin/clang++
LFLAGS = -stdlib=libc++ -headerpad_max_install_names $(EXPORT_ARCH_ARGS) -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wl,-rpath,#executable_path/../Frameworks
LIBS = $(SUBLIBS) -F/usr/local/Cellar/qt/5.14.1/lib -framework QtWidgets -framework QtGui -framework AppKit -framework Metal -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
AR = /Library/Developer/CommandLineTools/usr/bin/ar cq
RANLIB = /Library/Developer/CommandLineTools/usr/bin/ranlib -s
SED = sed
STRIP = strip
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = main.cpp
OBJECTS = main.o
DIST = /usr/local/Cellar/qt/5.14.1/mkspecs/features/spec_pre.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/qdevice.pri \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/device_config.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/common/unix.conf \
/usr/local/Cellar/qt/5.14.1/mkspecs/common/mac.conf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/mac/rez.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/mac/asset_catalogs.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/testcase_targets.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/exceptions.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/yacc.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/lex.prf \
MORE FILES HERE
test.pro main.cpp
QMAKE_TARGET = test
DESTDIR =
TARGET = test.app/Contents/MacOS/test
####### Custom Variables
EXPORT_QMAKE_MAC_SDK = macosx
EXPORT_QMAKE_MAC_SDK_VERSION = 10.15.1
EXPORT_QMAKE_XCODE_DEVELOPER_PATH = /Library/Developer/CommandLineTools
EXPORT_VALID_ARCHS = x86_64
EXPORT_ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
EXPORT_ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
EXPORT__PRO_FILE_ = /Users/myName/School/C++/QtTest/test.pro
include /usr/local/Cellar/qt/5.14.1/mkspecs/features/mac/sdk.mk
first: all
####### Build rules
test.app/Contents/MacOS/test: $(OBJECTS)
#test -d test.app/Contents/MacOS/ || mkdir -p test.app/Contents/MacOS/
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: test.pro /usr/local/Cellar/qt/5.14.1/mkspecs/macx-clang/qmake.conf /usr/local/Cellar/qt/5.14.1/mkspecs/features/spec_pre.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/qdevice.pri \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/device_config.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/common/unix.conf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/exceptions.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/yacc.prf \
/usr/local/Cellar/qt/5.14.1/mkspecs/features/lex.prf \
test.pro \
/usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Resources/QtWidgets.prl \
/usr/local/Cellar/qt/5.14.1/lib/QtGui.framework/Resources/QtGui.prl \
/usr/local/Cellar/qt/5.14.1/lib/QtCore.framework/Resources/QtCore.prl
MORE FILES HERE
$(QMAKE) -o Makefile test.pro
/usr/local/Cellar/qt/5.14.1/mkspecs/features/spec_pre.prf:
/usr/local/Cellar/qt/5.14.1/mkspecs/qdevice.pri:
/usr/local/Cellar/qt/5.14.1/mkspecs/features/device_config.prf:
/usr/local/Cellar/qt/5.14.1/mkspecs/common/unix.conf:
/usr/local/Cellar/qt/5.14.1/mkspecs/common/mac.conf:
/usr/local/Cellar/qt/5.14.1/mkspecs/features/lex.prf:
test.pro:
/usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Resources/QtWidgets.prl:
/usr/local/Cellar/qt/5.14.1/lib/QtGui.framework/Resources/QtGui.prl:
/usr/local/Cellar/qt/5.14.1/lib/QtCore.framework/Resources/QtCore.prl:
MORE FILES HERE
qmake: FORCE
#$(QMAKE) -o Makefile test.pro
qmake_all: FORCE
test.app/Contents/PkgInfo:
#test -d test.app/Contents || mkdir -p test.app/Contents
#$(DEL_FILE) test.app/Contents/PkgInfo
#echo "APPL????" > test.app/Contents/PkgInfo
test.app/Contents/Resources/empty.lproj:
#test -d test.app/Contents/Resources || mkdir -p test.app/Contents/Resources
#touch test.app/Contents/Resources/empty.lproj
test.app/Contents/Info.plist:
#test -d test.app/Contents || mkdir -p test.app/Contents
#$(DEL_FILE) test.app/Contents/Info.plist
#sed -e "s,#SHORT_VERSION#,1.0,g" -e "s,\$${QMAKE_SHORT_VERSION},1.0,g" -e "s,#FULL_VERSION#,1.0.0,g" -e "s,\$${QMAKE_FULL_VERSION},1.0.0,g" -e "s,#TYPEINFO#,????,g" -e "s,\$${QMAKE_PKGINFO_TYPEINFO},????,g" -e "s,#BUNDLEIDENTIFIER#,com.yourcompany.test,g" -e "s,\$${PRODUCT_BUNDLE_IDENTIFIER},com.yourcompany.test,g" -e "s,\$${MACOSX_DEPLOYMENT_TARGET},10.13,g" -e "s,\$${IPHONEOS_DEPLOYMENT_TARGET},,g" -e "s,\$${TVOS_DEPLOYMENT_TARGET},,g" -e "s,\$${WATCHOS_DEPLOYMENT_TARGET},,g" -e "s,#ICON#,,g" -e "s,\$${ASSETCATALOG_COMPILER_APPICON_NAME},,g" -e "s,#EXECUTABLE#,test,g" -e "s,#LIBRARY#,test,g" -e "s,\$${EXECUTABLE_NAME},test,g" -e "s,#TYPEINFO#,????,g" -e "s,\$${QMAKE_PKGINFO_TYPEINFO},????,g" /usr/local/Cellar/qt/5.14.1/mkspecs/macx-clang/Info.plist.app >test.app/Contents/Info.plist
all: Makefile \
test.app/Contents/PkgInfo \
test.app/Contents/Resources/empty.lproj \
test.app/Contents/Info.plist test.app/Contents/MacOS/test
dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
distdir: FORCE
#test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents /usr/local/Cellar/qt/5.14.1/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents main.cpp $(DISTDIR)/
clean: compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) -r test.app
-$(DEL_FILE) .qmake.stash
-$(DEL_FILE) Makefile
####### Sub-libraries
xcodeproj:
#$(QMAKE) -spec macx-xcode "$(EXPORT__PRO_FILE_)"
mocclean: compiler_moc_header_clean compiler_moc_objc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_objc_header_make_all compiler_moc_source_make_all
check: first
benchmark: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_predefs_make_all: moc_predefs.h
compiler_moc_predefs_clean:
-$(DEL_FILE) moc_predefs.h
moc_predefs.h: /usr/local/Cellar/qt/5.14.1/mkspecs/features/data/dummy.cpp
/Library/Developer/CommandLineTools/usr/bin/clang++ -pipe -stdlib=libc++ -O2 -std=gnu++11 $(EXPORT_ARCH_ARGS) -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -dM -E -o moc_predefs.h /usr/local/Cellar/qt/5.14.1/mkspecs/features/data/dummy.cpp
compiler_moc_header_make_all:
compiler_moc_header_clean:
compiler_moc_objc_header_make_all:
compiler_moc_objc_header_clean:
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_rez_source_make_all:
compiler_rez_source_clean:
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_moc_predefs_clean
####### Compile
main.o: main.cpp /usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Headers/QApplication \
/usr/local/Cellar/qt/5.14.1/lib/QtWidgets.framework/Headers/qapplication.h
$(CXX) $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
Thanks!
I made a very basic mistake. Everything was working, but the Makefile outputted a main.o file. I tried to execute my application by using ./main.o. This is not possible.
The correct way to execute a Qt application is by using open main.app.
No need to alter the makefile.
Create a myApp.pro file
Example:
TEMPLATE += app
QT += widgets gui
SOURCES += myApp.cpp
Execute qmake
Execute make
Execute open myApp.app

Trying to cross-compile qt4/qt5 applications from Linux Ubuntu 32bit to Windows (32bit)

I tried to cross-compile the following code:
//test.cpp
#include <QApplication>
#include <QWidget>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget window;
window.resize(250, 150);
window.setWindowTitle("Test");
window.show();
return app.exec();
}
following those instructions: Building Qt 5 on Linux, for Windows. I downloaded and built the source, created a Makefile and tried to build my project. after getting lot of undefined reference errors, I changed the includes to
#include "/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets/QApplication"
#include "/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets/QWidget"
and changed some paths in the Makefiles. But I am still getting lots of errors:
make
make -f Makefile.Release
make[1] : on entre dans le répertoire « /home/administrator/louis/buildwin »
/home/administrator/mxe/usr/bin/i686-w64-mingw32.static-g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I. -I../../mxe/usr/i686-w64-mingw32.static/qt5/include -I../../mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I../../mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++ -o release/test.o test.cpp
/home/administrator/mxe/usr/bin/i686-w64-mingw32.static-g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release/buildwin.exe release/test.o release/buildwin_plugin_import.o -lglu32 -lmingw32 -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libqtmain.a -L/home/administrator/mxe/usr/i686-w64-mingw32.static/lib -L/home/administrator/mxe/usr/i686-w64-mingw32.static/lib -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms/libqwindows.a -lwinspool /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5PlatformSupport.a /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5DBus.a -ldbus-1 -liphlpapi -ldbghelp -lnetapi32 -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats/libqico.a /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Gui.a -lcomdlg32 -loleaut32 -limm32 -lopengl32 -ljpeg -lharfbuzz -lcairo -lgobject-2.0 -lfontconfig -lusp10 -lmsimg32 -lgdi32 -lpixman-1 -lffi -lexpat -lfreetype -lbz2 -lharfbuzz_too -lglib-2.0 -lwinmm -lshlwapi -lpcre -lintl -liconv -lpng16 /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16
release/test.o:test.cpp:(.text+0x52): undefined reference to `QApplication::QApplication(int&, char**, int)'
release/test.o:test.cpp:(.text+0x73): undefined reference to `QWidget::QWidget(QWidget*, QFlags<Qt::WindowType>)'
release/test.o:test.cpp:(.text+0x99): undefined reference to `QWidget::resize(QSize const&)'
release/test.o:test.cpp:(.text+0xc8): undefined reference to `QWidget::setWindowTitle(QString const&)'
release/test.o:test.cpp:(.text+0xee): undefined reference to `QWidget::show()'
release/test.o:test.cpp:(.text+0xf3): undefined reference to `QApplication::exec()'
release/test.o:test.cpp:(.text+0xfe): undefined reference to `QWidget::~QWidget()'
release/test.o:test.cpp:(.text+0x106): undefined reference to `QApplication::~QApplication()'
release/test.o:test.cpp:(.text+0x177): undefined reference to `QWidget::~QWidget()'
release/test.o:test.cpp:(.text+0x17f): undefined reference to `QApplication::~QApplication()'
collect2: error: ld returned 1 exit status
Makefile.Release:62 : la recette pour la cible « release/buildwin.exe » a échouée
make[1]: *** [release/buildwin.exe] Erreur 1
make[1] : on quitte le répertoire « /home/administrator/louis/buildwin »
Makefile:34 : la recette pour la cible « release » a échouée
make: *** [release] Erreur 2
Those are the Makefiles. I only modified a few paths
in Makefile:
# Makefile for building: buildwin
# Generated by qmake (3.0) (Qt 5.7.1)
# Project: buildwin.pro
# Template: app
# Command: /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-qmake-qt5 -o Makefile buildwin.pro
MAKEFILE = Makefile
first: release
install: release-install
uninstall: release-uninstall
QMAKE = /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-qmake-qt5
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
SUBTARGETS = \
release \
debug
release: FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_first: FORCE
$(MAKE) -f $(MAKEFILE).Release
release-all: FORCE
$(MAKE) -f $(MAKEFILE).Release all
release-clean: FORCE
$(MAKE) -f $(MAKEFILE).Release clean
release-distclean: FORCE
$(MAKE) -f $(MAKEFILE).Release distclean
release-install: FORCE
$(MAKE) -f $(MAKEFILE).Release install
release-uninstall: FORCE
$(MAKE) -f $(MAKEFILE).Release uninstall
debug: FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_first: FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-all: FORCE
$(MAKE) -f $(MAKEFILE).Debug all
debug-clean: FORCE
$(MAKE) -f $(MAKEFILE).Debug clean
debug-distclean: FORCE
$(MAKE) -f $(MAKEFILE).Debug distclean
debug-install: FORCE
$(MAKE) -f $(MAKEFILE).Debug install
debug-uninstall: FORCE
$(MAKE) -f $(MAKEFILE).Debug uninstall
Makefile: buildwin.pro ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++/qmake.conf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_pre.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qdevice.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/device_config.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/common/angle.conf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qconfig.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
###I shortened here to fit the 30k limit...
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qwindows.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_windowsprintersupport.pri \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_functions.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_config.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/qt_config.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++/qmake.conf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_post.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/toolchain.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_pre.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/default_pre.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resolve_config.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds_post.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_post.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/rtti.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/precompile_header.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/warn_on.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resources.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/moc.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/opengl.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/file_copies.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/windows.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/testcase_targets.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exceptions.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/yacc.prf \
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/lex.prf \
buildwin.pro \
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/qtmain.prl \
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Gui.prl \
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Core.prl \
../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms/qwindows.prl \
../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats/qico.prl
$(QMAKE) -o Makefile buildwin.pro
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_pre.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qdevice.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/device_config.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/common/angle.conf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qconfig.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_core.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_core_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_dbus.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_dbus_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_gui.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_gui_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_network.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_network_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_opengl.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_opengl_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_openglextensions.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_printsupport.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_printsupport_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_sql.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_sql_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_testlib.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_testlib_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_widgets.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_widgets_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_xml.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_xml_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_zlib_private.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qgenericbearer.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qico.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qminimal.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qnativewifibearer.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlite.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlmysql.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlodbc.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlpsql.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqltds.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qtuiotouchplugin.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qwindows.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_windowsprintersupport.pri:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_functions.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_config.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/qt_config.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++/qmake.conf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_post.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/toolchain.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_pre.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/default_pre.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resolve_config.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds_post.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_post.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/rtti.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/precompile_header.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/warn_on.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resources.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/moc.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/opengl.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/file_copies.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/windows.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/testcase_targets.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exceptions.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/yacc.prf:
../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/lex.prf:
buildwin.pro:
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/qtmain.prl:
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Gui.prl:
../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Core.prl:
../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms/qwindows.prl:
../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats/qico.prl:
qmake: FORCE
#$(QMAKE) -o Makefile buildwin.pro
qmake_all: FORCE
make_first: release-make_first debug-make_first FORCE
all: release-all debug-all FORCE
clean: release-clean debug-clean FORCE
distclean: release-distclean debug-distclean FORCE
-$(DEL_FILE) Makefile
-$(DEL_FILE) /home/administrator/louis/buildwin/buildwin_plugin_import.cpp
release-mocclean:
$(MAKE) -f $(MAKEFILE).Release mocclean
debug-mocclean:
$(MAKE) -f $(MAKEFILE).Debug mocclean
mocclean: release-mocclean debug-mocclean
release-mocables:
$(MAKE) -f $(MAKEFILE).Release mocables
debug-mocables:
$(MAKE) -f $(MAKEFILE).Debug mocables
mocables: release-mocables debug-mocables
check: first
benchmark: first
FORCE:
$(MAKEFILE).Release: Makefile
$(MAKEFILE).Debug: Makefile
in Makefile.Release:
# Makefile for building: buildwin
# Generated by qmake (3.0) (Qt 5.7.1)
# Project: buildwin.pro
# Template: app
MAKEFILE = Makefile.Release
## Compiler, tools and options
CC = /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-gcc
CXX = /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-g++
DEFINES = -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN
CFLAGS = -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra $(DEFINES)
CXXFLAGS = -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads $(DEFINES)
INCPATH = -I. -I. -I../../mxe/usr/i686-w64-mingw32.static/qt5/include -I../../mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I../../mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++
LINKER = /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-g++
LFLAGS = -Wl,-s -Wl,-subsystem,windows -mthreads
LIBS = -lglu32 -lmingw32 -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libqtmain.a -L/home/administrator/mxe/usr/i686-w64-mingw32.static/lib -L/home/administrator/mxe/usr/i686-w64-mingw32.static/lib -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms/libqwindows.a -lwinspool /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5PlatformSupport.a /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5DBus.a -ldbus-1 -liphlpapi -ldbghelp -lnetapi32 -L/home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats/libqico.a /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Gui.a -lcomdlg32 -loleaut32 -limm32 -lopengl32 -ljpeg -lharfbuzz -lcairo -lgobject-2.0 -lfontconfig -lusp10 -lmsimg32 -lgdi32 -lpixman-1 -lffi -lexpat -lfreetype -lbz2 -lharfbuzz_too -lglib-2.0 -lwinmm -lshlwapi -lpcre -lintl -liconv -lpng16 /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16
QMAKE = /home/administrator/mxe/usr/bin/i686-w64-mingw32.static-qmake-qt5
IDC = idc
IDL = midl
ZIP =
DEF_FILE =
RES_FILE =
COPY = cp -f
SED = sed
COPY_FILE = cp -f
COPY_DIR = cp -f -R
DEL_FILE = rm -f
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
### Output directory
OBJECTS_DIR = release/
### Files
SOURCES = test.cpp /home/administrator/louis/buildwin/buildwin_plugin_import.cpp
OBJECTS = release/test.o \
release/buildwin_plugin_import.o
DIST = test.cpp
QMAKE_TARGET = buildwin
DESTDIR = release/ #avoid trailing-slash linebreak
TARGET = buildwin.exe
DESTDIR_TARGET = release/buildwin.exe
## Build rules
first: all
all: Makefile.Release $(DESTDIR_TARGET)
$(DESTDIR_TARGET): /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Gui.a /home/administrator/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a $(OBJECTS)
$(LINKER) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
#$(QMAKE) -o Makefile.Release buildwin.pro
qmake_all: FORCE
dist:
$(ZIP) buildwin.zip $(SOURCES) $(DIST) buildwin.pro ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_pre.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qdevice.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/device_config.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/common/angle.conf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/qconfig.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_concurrent_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_core.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_core_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_dbus.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_dbus_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_gui.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_gui_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_network.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_network_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_opengl.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_opengl_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_openglextensions.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_printsupport.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_printsupport_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_sql.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_sql_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_testlib.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_testlib_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_widgets.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_widgets_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_xml.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_xml_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_lib_zlib_private.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qgenericbearer.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qico.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qminimal.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qnativewifibearer.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlite.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlmysql.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlodbc.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqlpsql.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qsqltds.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qtuiotouchplugin.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_qwindows.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/modules/qt_plugin_windowsprintersupport.pri ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_functions.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt_config.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/qt_config.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++/qmake.conf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/spec_post.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/toolchain.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_pre.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/default_pre.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resolve_config.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exclusive_builds_post.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/default_post.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/build_pass.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/rtti.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/precompile_header.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/warn_on.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/qt.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/resources.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/moc.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/opengl.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/file_copies.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/win32/windows.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/testcase_targets.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/exceptions.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/yacc.prf ../../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/features/lex.prf buildwin.pro ../../mxe/usr/i686-w64-mingw32.static/qt5/lib/qtmain.prl ../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Gui.prl ../../mxe/usr/i686-w64-mingw32.static/qt5/lib/Qt5Core.prl ../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms/qwindows.prl ../../mxe/usr/i686-w64-mingw32.static/qt5/plugins/imageformats/qico.prl NO_PCH_SOURCES RESOURCES HEADERS SOURCES OBJECTIVE_SOURCES YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) release/test.o release/buildwin_plugin_import.o
distclean: clean
-$(DEL_FILE) /home/administrator/louis/buildwin/buildwin_plugin_import.cpp
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Release
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
benchmark: first
compiler_no_pch_compiler_make_all:
compiler_no_pch_compiler_clean:
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_header_make_all:
compiler_moc_header_clean:
compiler_moc_source_make_all:
compiler_moc_source_clean:
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:
####### Compile
release/test.o: test.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/test.o test.cpp
release/buildwin_plugin_import.o: /home/administrator/louis/buildwin/buildwin_plugin_import.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/buildwin_plugin_import.o /home/administrator/louis/buildwin/buildwin_plugin_import.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
Probably it is just a simple include mistake, or a wrong line in the makefiles
Thanks in advance for help

Syntax error: EOF in backquote substitution make: *** [mainwindow.o] Error 2

I am trying to compile a Qt project downloaded from Git hub. I got the following error during the compilation.
/bin/sh: 1: Syntax error: EOF in backquote substitution
make: * [mainwindow.o] Error 2
****08:33:27: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project FiniteElements (kit: Desktop)
When executing step 'Make'******
My .pro file is as below,
QT += core gui opengl widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000`
TARGET = FiniteElements
TEMPLATE = app
LIBS += -lqwt
INCLUDEPATH += "/usr/include/qwt/"
SOURCES += main.cpp\
mainwindow.cpp \
FiniteElements.cpp \
graph_plot.cpp
HEADERS += mainwindow.h \
FiniteElements.h \
graph_plot.h
Can anyone help me?
Instructions tested on Ubuntu 16.04.1 LTS with qt5-default 5.5.1+dfsg-16ubuntu7 and libqwt-qt5-dev 6.1.2-5 installed:
Clone the repo:
$ git clone https://github.com/MKrishtop/FiniteElements.git
Cloning into 'FiniteElements'...
remote: Counting objects: 17, done.
remote: Total 17 (delta 0), reused 0 (delta 0), pack-reused 17
Unpacking objects: 100% (17/17), done.
Checking connectivity... done.
Port from Qt 4 to Qt 5:
$ cd FiniteElements/
$ find . -type f -exec sed -i 's/QtGui/QtWidgets/g' {} \;
$ find . -type f -exec sed -i 's/toAscii/toLocal8Bit/g' {} \;
$ sed -i 's/-lqwt/-lqwt-qt5/g' FiniteElements.pro
For the reference, here's the full diff:
$ git diff
diff --git a/FiniteElements.pro b/FiniteElements.pro
index a2edb50..610f9f7 100644
--- a/FiniteElements.pro
+++ b/FiniteElements.pro
## -8,7 +8,7 ## QT += core gui opengl
TARGET = FiniteElements
TEMPLATE = app
-LIBS += -lqwt
+LIBS += -lqwt-qt5
INCLUDEPATH += "/usr/include/qwt/"
diff --git a/graph_plot.h b/graph_plot.h
index 551941b..00cf205 100644
--- a/graph_plot.h
+++ b/graph_plot.h
## -1,7 +1,7 ##
#ifndef GRAPH_PLOT_H
#define GRAPH_PLOT_H
-#include <QtGui/QtGui>
+#include <QtWidgets/QtWidgets>
#include <QApplication>
#include <QString>
#include <qwt_plot.h>
diff --git a/main.cpp b/main.cpp
index 6bf7836..338bba0 100644
--- a/main.cpp
+++ b/main.cpp
## -1,4 +1,4 ##
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
#include <qwt_plot.h>
#include "mainwindow.h"
#include "FiniteElements.h"
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 1f0145f..2ecec7d 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
## -1,4 +1,4 ##
-#include <QtGui>
+#include <QtWidgets>
#include "mainwindow.h"
## -25,7 +25,7 ## void MainWindow::browse()
QString filepath = QFileDialog::getOpenFileName(this,tr("Select input datafile"),QDir::currentPath());
if (!filepath.isEmpty()) {
- std::string str = std::string(filepath.toAscii().data());
+ std::string str = std::string(filepath.toLocal8Bit().data());
const char * stuff = str.c_str();
A->SetFN(stuff);
A->evaluate();
diff --git a/mainwindow.h b/mainwindow.h
index fc8f0fb..4bcf0e1 100644
--- a/mainwindow.h
+++ b/mainwindow.h
## -3,7 +3,7 ##
#include <QDialog>
#include <QDir>
-#include <QtGui/QtGui>
+#include <QtWidgets/QtWidgets>
#include <QApplication>
#include <QString>
#include "FiniteElements.h"
Build:
$ qmake -v
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu
$ qmake
$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o main.o main.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o mainwindow.o mainwindow.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o FiniteElements.o FiniteElements.cpp
FiniteElements.cpp: In member function 'int FiniteElements::local_node()':
FiniteElements.cpp:185:6: warning: unused variable 'kf' [-Wunused-variable]
int kf=0,i=bpn,k=0;
^
FiniteElements.cpp:185:11: warning: unused variable 'i' [-Wunused-variable]
int kf=0,i=bpn,k=0;
^
FiniteElements.cpp:185:17: warning: unused variable 'k' [-Wunused-variable]
int kf=0,i=bpn,k=0;
^
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o graph_plot.o graph_plot.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/home/jpnurmi/Temp/FiniteElements -I/usr/include/qwt -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include mainwindow.h -o moc_mainwindow.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o moc_mainwindow.o moc_mainwindow.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/home/jpnurmi/Temp/FiniteElements -I/usr/include/qwt -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include graph_plot.h -o moc_graph_plot.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o moc_graph_plot.o moc_graph_plot.cpp
g++ -m64 -Wl,-O1 -o FiniteElements main.o mainwindow.o FiniteElements.o graph_plot.o moc_mainwindow.o moc_graph_plot.o -L/usr/X11R6/lib64 -lqwt-qt5 -lQt5OpenGL -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
$

Qt - statically compiled exe refers shared lib

My static compilation in Qt worked fine upto this week. I reinstalled the qt, and recompiled the static version. The headache started after this. Now, even though I compiled using tatic version. The resulting exe requires the Qt libs. I checked the exe with "dependency Walker". It showed that the required dll's path are pointing towards the dynamic/shared libs path. Here are my settings
Environment:
QTDYNDIR : D:\tempinstallationfolder\Qt\dynamic
QTSTADIR : D:\tempinstallationfolder\Qt\static
Path : %QTDYNDIR%\bin;%QTDYNDIR%\qt\bin;%QTDYNDIR%\mingw\bin;
%QTSTADIR%\bin;%QTSTADIR%\qt\bin;%QTSTADIR%\mingw\bin;
I add the mingw,qt paths
Somehow it manages to follow the dynamic lib's path. I don't know where I made the mistake.
Can anybody help me in this issue?.
Note: I am using Windows platform - qt - 4.7.0 (qt - open source v2010.05)of static,dynamic to the Qt-Creater=>Tools=>Options=>Qt.
EDIT:
This one is from the compile output. There is no dynamic path directory mentioned in these.
Running build steps for project CalendarNew...
Starting: "D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make.exe" clean -w
mingw32-make: Entering directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
del release\moc_CalendarWidget.cpp release\moc_DateSquareEditWidget.cpp release\moc_GeneralSettingsWidget.cpp release\moc_MyColorButton.cpp release\moc_MyLabel.cpp
del release\CalendarWidget.o release\DateSquare.o release\DateSquareEditWidget.o release\GeneralSettingsWidget.o release\main.o release\MyColorButton.o release\MyLabel.o release\moc_CalendarWidget.o release\moc_DateSquareEditWidget.o release\moc_GeneralSettingsWidget.o release\moc_MyColorButton.o release\moc_MyLabel.o
mingw32-make[1]: Leaving directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
del debug\moc_CalendarWidget.cpp debug\moc_DateSquareEditWidget.cpp debug\moc_GeneralSettingsWidget.cpp debug\moc_MyColorButton.cpp debug\moc_MyLabel.cpp
del debug\CalendarWidget.o debug\DateSquare.o debug\DateSquareEditWidget.o debug\GeneralSettingsWidget.o debug\main.o debug\MyColorButton.o debug\MyLabel.o debug\moc_CalendarWidget.o debug\moc_DateSquareEditWidget.o debug\moc_GeneralSettingsWidget.o debug\moc_MyColorButton.o debug\moc_MyLabel.o
mingw32-make[1]: Leaving directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
mingw32-make: Leaving directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
Could Not Find C:\Documents and Settings\prabhakaran\Desktop\CalendarNew-build-desktop\debug\moc_CalendarWidget.cpp
Could Not Find C:\Documents and Settings\prabhakaran\Desktop\CalendarNew-build-desktop\debug\CalendarWidget.o
The process "D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make.exe" exited normally.
Configuration unchanged, skipping qmake step.
Starting: "D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\CalendarWidget.o ..\CalendarNew\CalendarWidget.cpp
..\CalendarNew\CalendarWidget.cpp: In constructor 'CalendarWidget::CalendarWidget()':
..\CalendarNew\CalendarWidget.cpp:93: warning: 'default_String_Fontsize' may be used uninitialized in this function
..\CalendarNew\CalendarWidget.cpp:96: warning: 'lower_String_Fontsize' may be used uninitialized in this function
..\CalendarNew\CalendarWidget.cpp: In constructor 'CalendarWidget::CalendarWidget()':
..\CalendarNew\CalendarWidget.cpp:93: warning: 'default_String_Fontsize' may be used uninitialized in this function
..\CalendarNew\CalendarWidget.cpp:96: warning: 'lower_String_Fontsize' may be used uninitialized in this function
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\DateSquare.o ..\CalendarNew\DateSquare.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\DateSquareEditWidget.o ..\CalendarNew\DateSquareEditWidget.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\GeneralSettingsWidget.o ..\CalendarNew\GeneralSettingsWidget.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\main.o ..\CalendarNew\main.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\MyColorButton.o ..\CalendarNew\MyColorButton.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\MyLabel.o ..\CalendarNew\MyLabel.cpp
D:\TempInstallationFolder\Qt\static\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\CalendarNew\CalendarWidget.h -o release\moc_CalendarWidget.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\moc_CalendarWidget.o release\moc_CalendarWidget.cpp
D:\TempInstallationFolder\Qt\static\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\CalendarNew\DateSquareEditWidget.h -o release\moc_DateSquareEditWidget.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\moc_DateSquareEditWidget.o release\moc_DateSquareEditWidget.cpp
D:\TempInstallationFolder\Qt\static\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\CalendarNew\GeneralSettingsWidget.h -o release\moc_GeneralSettingsWidget.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\moc_GeneralSettingsWidget.o release\moc_GeneralSettingsWidget.cpp
D:\TempInstallationFolder\Qt\static\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\CalendarNew\MyColorButton.h -o release\moc_MyColorButton.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\moc_MyColorButton.o release\moc_MyColorButton.cpp
D:\TempInstallationFolder\Qt\static\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\CalendarNew\MyLabel.h -o release\moc_MyLabel.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\TempInstallationFolder\Qt\static\qt\include\QtCore" -I"d:\TempInstallationFolder\Qt\static\qt\include\QtGui" -I"d:\TempInstallationFolder\Qt\static\qt\include" -I"..\CalendarNew" -I"d:\TempInstallationFolder\Qt\static\qt\include\ActiveQt" -I"release" -I"." -I"d:\TempInstallationFolder\Qt\static\qt\mkspecs\win32-g++" -o release\moc_MyLabel.o release\moc_MyLabel.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\CalendarNew.exe object_script.CalendarNew.Release -L"d:\TempInstallationFolder\Qt\static\qt\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
mingw32-make: Leaving directory `C:/Documents and Settings/prabhakaran/Desktop/CalendarNew-build-desktop'
The process "D:/TempInstallationFolder/Qt/static/mingw/bin/mingw32-make.exe" exited normally.
Note: Now only I made the fresh install for dynamic and static . Still it is capable to produce the same result.
Have you added this line to your projectname.pro file?
CONFIG += static
and made sure that in QtCreator-Projects-Build settings the 'Qt-version' points to your static build?
I am not sure that this is the correct answer. I made the following changes. I am not sure which one corrected my problem.
1)It seems there must be a environment variable called as QTDIR which points to the dynamic installation dir.
2)I compiled the qt libs for static build using "visual studio" rather than "mingw".
After these steps I added the absolute paths of static and dynamic (qt-bin,lib,minwg-bin,lib) to the path.
Now, my things are working fine. I didn't vote it as a correct answer. Thereby some one can give the exact answer.