I know I can run qmake from the command line and use:
-spec linux-g++-32
From the .pro file i've tried to add alternatively "-m32" or "-32" to "CFLAGS" or "QMAKE_CXXFLAGS" but it does not work.
CFLAGS += -m32
QMAKE_CXXFLAGS += -m32
What shall I do then ?
EDIT:
this is what is produced with the above flag...
g++ -c -pipe -m32 -g -Wall -W -D_REENTRANT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I. -o fxa_march.o ../fxa_march/fxa_march.cpp
g++ -c -pipe -m32 -g -Wall -W -D_REENTRANT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I. -o reports.o ../fxa_march/reports.cpp
g++ -c -pipe -m32 -g -Wall -W -D_REENTRANT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I. -o fxa_march_params.o ../fxa_march/fxa_march_params.cpp
g++ -c -pipe -m32 -g -Wall -W -D_REENTRANT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I. -o reportgroup.o ../fxa_march/reportgroup.cpp
g++ -c -pipe -m32 -g -Wall -W -D_REENTRANT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I. -o db_wrapper.o ../fxa_march/db_wrapper.cpp
../fxa_march/db_wrapper.cpp: In function 'std::string as_string(FX::dbvalue, FX::dbtype)':
../fxa_march/db_wrapper.cpp:17: warning: enumeration value 'dbtype_dbvoid' not handled in switch
../fxa_march/db_wrapper.cpp:17: warning: enumeration value 'dbtype_dbdate' not handled in switch
../fxa_march/db_wrapper.cpp:17: warning: enumeration value 'dbtype_dbmoney' not handled in switch
g++ -Wl,-rpath,/Soft/fox_dev/Qt-4.7.4/lib -o fxa_march fxa_march.o reports.o fxa_march_params.o reportgroup.o db_wrapper.o -L/Soft/fox_dev/Qt-4.7.4/lib -L../../../fx/libfx -lfx -L../../../fx/MQLib -lMQ -L/Soft/fox_dev/boost/boost_bin/lib -lboost_timer -lboost_system -lboost_chrono -lboost_regex -L/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/lib -lxerces-c -lQtXmlPatterns -L/Soft/fox_dev/Qt-4.7.4/lib -lQtNetwork -lQtXml -lQtCore -lpthread
/usr/bin/ld: skipping incompatible ../../../fx/libfx/libfx.so when searching for -lfx
/usr/bin/ld: cannot find -lfx
collect2: ld returned 1 exit status
make: *** [fxa_march] Error 1
Ok, here is the point:
the diff between the generated makefile ( through QtCreator ) and the one generated by my command line is:
INCPATH = -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++-32 -I. -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I.
Vs
INCPATH = -I/Soft/fox_dev/Qt-4.7.4/mkspecs/linux-g++ -I../fxa_march -I/Soft/fox_dev/Qt-4.7.4/include/QtCore -I/Soft/fox_dev/Qt-4.7.4/include/QtXml -I/Soft/fox_dev/Qt-4.7.4/include/QtXmlPatterns -I/Soft/fox_dev/Qt-4.7.4/include -I../../../fx/libfx -I../../../fx/MQLib -I/Soft/fox_dev/boost/boost_1_54_0 -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I/Soft/fox_dev/xerces-c-3.1.1-x86-linux-gcc-3.4/include -I. -I../fxa_march -I.
however one can go to "Project-> Build Settings -> [choose configuration to modify] -> And edit the "Qmake step" with additionnal argument:
-spec linux-g++-32
you will also need to add in the .pro file either of:
CFLAGS += -m32
QMAKE_CXXFLAGS += -m32
In .pro file, try writting all commands inside a scope prefixed by win32
win32 {
SOURCES += paintwidget_win.cpp
# ...
}
Commands inside the scope will be run only if the win32 variable is set.
Related
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)'
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
$
I am trying to create a system of makefiles to build my whole project. I am using cygwin and gcc compiler. I am running into a linking error on shared libraries that I cannot figure out.
I am concerned with ld: cannot find -lbase and ld: cannot find -lsimsimA429.
These files were clearly built. I even did a directory listing as part of the build command to show that they exist.
-rwxr-xr-x+ 1 user group 116832 Mar 25 10:09 /cygdrive/d/myProj/lib/libbase.so
-rwxr-xr-x+ 1 user group 75972 Mar 25 10:09 /cygdrive/d/myProj/lib/libsimsima429.so
and the link command also shows that I am including the correct link directory
g++ -shared -L/cygdrive/d/myProj/lib -lpthread -lrt -lbase -lsimsimA429 ...
What am I doing wrong to incur this error?
Also, I am relatively new to writing makefiles. If you have any comments about how I could improve them, I would kindly appreciate a few comments.
Full makefiles and output are listed below...
/cygdrive/d/myProj/src/sfi/base/makefile
#------------------------------------------------------------------------------
#-- BASE
#------------------------------------------------------------------------------
#--
# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
MKDIR=mkdir
ROOTDIR=$(realpath ../../..)
PROJDIR=$(notdir $(CURDIR))
LIBDIR=$(ROOTDIR)/lib
OBJDIR=$(ROOTDIR)/obj/$(PROJDIR)
SRCDIR=$(ROOTDIR)/src
#OUTPUT FILE lib file or executable
TARGET=$(LIBDIR)/lib$(PROJDIR).so
INCLUDES=
#INCLUDES+=
LIBS=
#LIBS+=
LDFLAGS=
LDFLAGS+= -shared
LDFLAGS+= -L$(LIBDIR)
#LDFLAGS+= -Wl,-rpath
CCFLAGS=
#CCFLAGS+= -fPIC
#CCFLAGS+= -ansi
#CCFLAGS+= -pedantic
CCFLAGS+= -g
CCFLAGS+= -Wall
#CCFLAGS+= -std=c++11
CCC=g++
SRC= $(call rwildcard,./,*.cpp)
OBJECTS=$(patsubst %.cpp,$(OBJDIR)/%.o,$(SRC))
# Set our own Goal.
.DEFAULT_GOAL := all
.PHONY: all
all: $(TARGET)
$(OBJDIR)/%.o: %.cpp
#$(MKDIR) -p $(abspath $(dir $#))
$(CCC) -c $(CCFLAGS) $(INCLUDES) $< -o $#
$(TARGET): $(OBJECTS)
$(CCC) $(LDFLAGS) $(LIBS) -o $(TARGET) $(OBJECTS)
ls -l $(TARGET)
.PHONY: clean
clean:
rm -f $(OBJECTS) $(TARGET)
test:
#echo $(OBJECTS) | tr " " "\n"
/cygdrive/d/myProj/src/sfi/drivers/a429/simsimA429/makefile
#------------------------------------------------------------------------------
#-- SIMSIMA429
#------------------------------------------------------------------------------
#--
# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
MKDIR=mkdir
ROOTDIR=$(realpath ../../../../..)
PROJDIR=$(notdir $(CURDIR))
LIBDIR=$(ROOTDIR)/lib
OBJDIR=$(ROOTDIR)/obj/$(PROJDIR)
SRCDIR=$(ROOTDIR)/src
#OUTPUT FILE lib file or executable
TARGET=$(LIBDIR)/lib$(PROJDIR).so
INCLUDES=
INCLUDES+= -I$(SRCDIR)/face
INCLUDES+= -I$(SRCDIR)/sfi/base
INCLUDES+= -I$(SRCDIR)/sfi/drivers/a429/include
LIBS=
LIBS+= -L$(LIBDIR)
#LIBS+= -lbase
LDFLAGS=
LDFLAGS+= -shared
#LDFLAGS+= -Wl,-rpath
CCFLAGS=
#CCFLAGS+= -fPIC
#CCFLAGS+= -ansi
#CCFLAGS+= -pedantic
CCFLAGS+= -g
CCFLAGS+= -Wall
#CCFLAGS+= -std=c++11
CCC=g++
SRC= $(call rwildcard,./,*.cpp)
OBJECTS=$(patsubst %.cpp,$(OBJDIR)/%.o,$(SRC))
# Set our own Goal.
.DEFAULT_GOAL := all
.PHONY: all
all: $(TARGET)
$(OBJDIR)/%.o: %.cpp
#$(MKDIR) -p $(abspath $(dir $#))
$(CCC) -c $(CCFLAGS) $(INCLUDES) $< -o $#
$(TARGET): $(OBJECTS)
$(CCC) $(LDFLAGS) $(LIBS) -o $(TARGET) $(OBJECTS)
ls -l $(TARGET)
.PHONY: clean
clean:
rm -f $(OBJECTS) $(TARGET)
test:
#echo $(OBJECTS) | tr " " "\n"
/cygdrive/d/myProj/src/sfi/ioss/makefile
#------------------------------------------------------------------------------
#-- IOSS
#------------------------------------------------------------------------------
#--
# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
MKDIR=mkdir
ROOTDIR=$(realpath ../../..)
PROJDIR=$(notdir $(CURDIR))
LIBDIR=$(ROOTDIR)/lib
OBJDIR=$(ROOTDIR)/obj/$(PROJDIR)
SRCDIR=$(ROOTDIR)/src
#OUTPUT FILE lib file or executable
TARGET=$(LIBDIR)/lib$(PROJDIR).so
INCLUDES=
INCLUDES+= -I$(SRCDIR)/face
INCLUDES+= -I$(SRCDIR)/sfi
INCLUDES+= -I$(SRCDIR)/sfi/base
INCLUDES+= -I$(SRCDIR)/sfi/drivers/a429/include
INCLUDES+= -I$(SRCDIR)/sfi/ioss
LIBS=
LIBS+= -L$(LIBDIR)
LIBS+= -lpthread
LIBS+= -lrt
LIBS+= -lbase
LIBS+= -lsimsima429
LDFLAGS=
LDFLAGS+= -shared
#LDFLAGS+= -Wl,-rpath
CCFLAGS=
#CCFLAGS+= -fPIC
#CCFLAGS+= -ansi
#CCFLAGS+= -pedantic
CCFLAGS+= -g
CCFLAGS+= -Wall
#CCFLAGS+= -std=c++11
CCC=g++
SRC= $(call rwildcard,./,*.cpp)
OBJECTS=$(patsubst %.cpp,$(OBJDIR)/%.o,$(SRC))
# Set our own Goal.
.DEFAULT_GOAL := all
.PHONY: all
all: $(TARGET)
$(OBJDIR)/%.o: %.cpp
#$(MKDIR) -p $(abspath $(dir $#))
$(CCC) -c $(CCFLAGS) $(INCLUDES) $< -o $#
$(TARGET): $(OBJECTS)
$(CCC) $(LDFLAGS) $(LIBS) -o $(TARGET) $(OBJECTS)
ls -l $(TARGET)
.PHONY: clean
clean:
rm -f $(OBJECTS) $(TARGET)
test:
#echo $(OBJECTS) | tr " " "\n"
Full Output:
10:09:19 **** Build of configuration Default for project base ****
make -j all
g++ -c -g -Wall udpserver.cpp -o /cygdrive/d/myProj/obj/base/./udpserver.o
g++ -c -g -Wall udpclient.cpp -o /cygdrive/d/myProj/obj/base/./udpclient.o
g++ -c -g -Wall impl/clock.cpp -o /cygdrive/d/myProj/obj/base/./impl/clock.o
g++ -c -g -Wall impl/deque.cpp -o /cygdrive/d/myProj/obj/base/./impl/deque.o
g++ -c -g -Wall impl/thread.cpp -o /cygdrive/d/myProj/obj/base/./impl/thread.o
g++ -shared -L/cygdrive/d/myProj/lib -o /cygdrive/d/myProj/lib/libbase.so /cygdrive/d/myProj/obj/base/./udpserver.o /cygdrive/d/myProj/obj/base/./udpclient.o /cygdrive/d/myProj/obj/base/./impl/clock.o /cygdrive/d/myProj/obj/base/./impl/Stdafx.o /cygdrive/d/myProj/obj/base/./impl/deque.o /cygdrive/d/myProj/obj/base/./impl/thread.o
ls -l /cygdrive/d/myProj/lib/libbase.so
-rwxr-xr-x+ 1 user group 116832 Mar 25 10:09 /cygdrive/d/myProj/lib/libbase.so
10:09:25 Build Finished (took 5s.994ms)
10:09:25 **** Build of configuration Default for project simsimA429 ****
make all
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include A429HwCtrlTx.cpp -o /cygdrive/d/myProj/obj/simsima429/./A429HwCtrlTx.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include A429HwCtrlRx.cpp -o /cygdrive/d/myProj/obj/simsima429/./A429HwCtrlRx.o
g++ -shared -L/cygdrive/d/myProj/lib -o /cygdrive/d/myProj/lib/libsimsima429.so /cygdrive/d/myProj/obj/simsima429/./A429HwCtrlTx.o /cygdrive/d/myProj/obj/simsima429/./A429HwCtrlRx.o
ls -l /cygdrive/d/myProj/lib/libsimsima429.so
-rwxr-xr-x+ 1 user group 75972 Mar 25 10:09 /cygdrive/d/myProj/lib/libsimsima429.so
10:09:29 Build Finished (took 4s.339ms)
10:09:29 **** Build of configuration Default for project ioss ****
make -j all
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss IOS.cpp -o /cygdrive/d/myProj/obj/ioss/./IOS.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss message/IOSmsg.cpp -o /cygdrive/d/myProj/obj/ioss/./message/IOSmsg.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss message/MsgId.cpp -o /cygdrive/d/myProj/obj/ioss/./message/MsgId.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss message/IOSmsgA429.cpp -o /cygdrive/d/myProj/obj/ioss/./message/IOSmsgA429.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss interface/IOSInterfaceHandle.cpp -o /cygdrive/d/myProj/obj/ioss/./interface/IOSInterfaceHandle.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss interface/IOSInterface.cpp -o /cygdrive/d/myProj/obj/ioss/./interface/IOSInterface.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss interface/direct/IOSDirect_Interface.cpp -o /cygdrive/d/myProj/obj/ioss/./interface/direct/IOSDirect_Interface.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429MajorFrame.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MajorFrame.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429MsgRxControl.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgRxControl.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429BusTx.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429BusTx.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429MsgRegistry.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgRegistry.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429BusRx.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429BusRx.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429Message.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429Message.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/a429/A429MsgBuffer.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgBuffer.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss bus/m1553/M1553Connection.cpp -o /cygdrive/d/myProj/obj/ioss/./bus/m1553/M1553Connection.o
g++ -c -g -Wall -I/cygdrive/d/myProj/src/face -I/cygdrive/d/myProj/src/sfi -I/cygdrive/d/myProj/src/sfi/base -I/cygdrive/d/myProj/src/sfi/drivers/a429/include -I/cygdrive/d/myProj/src/sfi/ioss config/IOSConfig.cpp -o /cygdrive/d/myProj/obj/ioss/./config/IOSConfig.o
g++ -shared -L/cygdrive/d/myProj/lib -lpthread -lrt -lbase -lsimsima429 -o /cygdrive/d/myProj/lib/libioss.so /cygdrive/d/myProj/obj/ioss/./IOS.o /cygdrive/d/myProj/obj/ioss/./message/IOSmsg.o /cygdrive/d/myProj/obj/ioss/./message/MsgId.o /cygdrive/d/myProj/obj/ioss/./message/IOSmsgA429.o /cygdrive/d/myProj/obj/ioss/./interface/IOSInterfaceHandle.o /cygdrive/d/myProj/obj/ioss/./interface/IOSInterface.o /cygdrive/d/myProj/obj/ioss/./interface/direct/IOSDirect_Interface.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MajorFrame.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgRxControl.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429BusTx.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgRegistry.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429BusRx.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429Message.o /cygdrive/d/myProj/obj/ioss/./bus/a429/A429MsgBuffer.o /cygdrive/d/myProj/obj/ioss/./bus/m1553/M1553Connection.o /cygdrive/d/myProj/obj/ioss/./config/IOSConfig.o
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lbase
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsimsima429
collect2: error: ld returned 1 exit status
makefile:61: recipe for target '/cygdrive/d/myProj/lib/libioss.so' failed
make: *** [/cygdrive/d/myProj/lib/libioss.so] Error 1
10:09:42 Build Finished (took 13s.205ms)
Cygwin shared libraries are *.dll files, not lib*.so files. I suppose your linker is struggling to find base.dll and simsimA429.dll.
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.
I am triyng to implement Matlab in a c++ program. http://www.cl.cam.ac.uk/~sjeh3/wii/
The application is using gtk a wii mote lib and the Matlab Camera Calibration Toolbox (http://www.vision.caltech.edu/bouguetj/calib_doc/ ). it works perfectly.
I want to use matlab ploting tools to build a graphic provided by the application. But i am having issues building the app with matlab engine .
In the main.cpp i just added the code from the matlab example engdemo.cpp in the main function and included engine.h and mex.h.
Even with the examples like engdemo.cpp i always have this error :
mex: link of ' "...mexa64"' failed.
here are the console views:
root#ubuntu:/home/hugo/Bureau/sjeh3-wii/wmgui# ./build2
----------------------------------------------------------------
-> mbuildopts.sh sourced from directory (DIR = $HOME/.matlab/$REL_VERSION)
FILE = /root/.matlab/R2009b/mbuildopts.sh
----------------------------------------------------------------
-> TMW_ROOT = /home/hugo/Matlab
-> CC = g++-4.1
-> CC flags:
CFLAGS = -ansi -D_GNU_SOURCE -I/home/hugo/Matlab/extern/include/cpp -I/home/hugo/Matlab/extern/include -DUNIX -DX11 -DGLNXA64 -DGCC -pthread
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/runtime/glnxa64 -lmwmclmcrrt -lm
arguments =
-> LD = g++-4.1
-> Link flags:
LDFLAGS = -pthread
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
arguments = -L/usr/lib/ -L../toolbox -L../libcwiid -L../libcwiid -L/opt/gnome/lib64 -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox
----------------------------------------------------------------
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -ansi -D_GNU_SOURCE -I/home/hugo/Matlab/extern/include/cpp -I/home/hugo/Matlab/extern/include -DUNIX -DX11 -DGLNXA64 -DGCC -pthread -g "main.cpp"
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -ansi -D_GNU_SOURCE -I/home/hugo/Matlab/extern/include/cpp -I/home/hugo/Matlab/extern/include -DUNIX -DX11 -DGLNXA64 -DGCC -pthread -g "interface.cpp"
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -ansi -D_GNU_SOURCE -I/home/hugo/Matlab/extern/include/cpp -I/home/hugo/Matlab/extern/include -DUNIX -DX11 -DGLNXA64 -DGCC -pthread -g "support.cpp"
-> g++-4.1 -g -pthread -L/usr/lib/ -L../toolbox -L../libcwiid -L../libcwiid -L/opt/gnome/lib64 -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox -o wmgui main.o interface.o support.o -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/runtime/glnxa64 -lmwmclmcrrt -lm -lcalib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid
main.o: In function `main':
/home/hugo/Bureau/sjeh3-wii/wmgui/main.cpp:363: undefined reference to `engOpen'
/home/hugo/Bureau/sjeh3-wii/wmgui/main.cpp:367: undefined reference to `engEvalString'
collect2: ld returned 1 exit status
mbuild: link of 'wmgui' failed.
root#ubuntu:/home/hugo/Bureau/sjeh3-wii/wmgui# ./build2
-> mexopts.sh sourced from directory (DIR = $HOME/.matlab/$REL_VERSION)
FILE = /root/.matlab/R2009b/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /home/hugo/Matlab
-> CC = gcc-4.1
-> CC flags:
CFLAGS = -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DMX_COMPAT_32
-> CXX = g++-4.1
-> CXX flags:
CXXFLAGS = -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DMX_COMPAT_32
-> FC = g95
-> FC flags:
FFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DMX_COMPAT_32
-> LD = g++-4.1
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/home/hugo/Matlab/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lang cpp -L/usr/lib/ -L../toolbox -L../libcwiid -lcalib -L../libcwiid -L/opt/gnome/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lang cpp -L/usr/lib/ -L../toolbox -L../libcwiid -lcalib -L../libcwiid -L/opt/gnome/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox
----------------------------------------------------------------
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -g "main.cpp"
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -g "interface.cpp"
-> g++-4.1 -c -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64 -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -g "support.cpp"
-> g++-4.1 -g -pthread -shared -Wl,--version-script,/home/hugo/Matlab/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "wmgui.mexa64" main.o interface.o support.o -lang cpp -L/usr/lib/ -L../toolbox -L../libcwiid -lcalib -L../libcwiid -L/opt/gnome/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox -Wl,-rpath-link,/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/bin/glnxa64 -lmx -lmex -lmat -lm
g++-4.1: cpp: Aucun fichier ou dossier de ce type
mex: link of ' "wmgui.mexa64"' failed.
#!/bin/sh
(mex or mbuild) -v -g -output wmgui main.cpp interface.cpp support.cpp -lang cpp \
-L/usr/lib/ -L../toolbox -L../libcwiid -lcalib -L../libcwiid -L/opt/gnome/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox \
-I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64
I forgot to say that i wanted to use Matlab engine and not my c++ application in matlab. maybe it wasn't so clear. I don't think the program will work as a mex-file.
Sincerely,
Hugo
If found my issue. i was compiling my application using mexopts.sh conf and not engopts.sh
After the succeful compilation i had the Error Can't start Matlab engine. i just apt-get install csh. and it work.
Your linux build command is broken. the compiler is missing some paths to some library.
#!/bin/sh
(mex or mbuild) -v -g -output wmgui main.cpp interface.cpp support.cpp -lang cpp \
-L/usr/lib/ -L../toolbox -L../libcwiid -lcalib -L../libcwiid -L/opt/gnome/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp -lgthread-2.0 -lglib-2.0 -lm -lcwiid -L/home/hugo/Matlab/bin/glnxa64 -L/home/hugo/Matlab/extern/include -L../../matlablibtest/toolbox \
-I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtk-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I../libcwiid -I../toolbox -I/opt/matlab/extern/include -I/usr/lib -I/home/hugo/Matlab/extern/include -I/home/hugo/Matlab/bin/glnxa64
Normaly you should find your anwser in this line code !
Sincerely
Hugo