PDA

View Full Version : Linking problem Windows 7 (64 bit) Qwt 6.1.0-rc3 + Qt 5.0.2



sol_kanar
17th April 2013, 13:18
Hi!

I am relatively a n00b in compiling under Windows. I followed the instruction to install Qwt-6.1.0-rc3, and apparently it worked. I am now trying to compile a project that makes use of QwtPlot, with the following (messy) .pro file:



CONFIG += qwt\
qt
QT += core\
gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = VisualDiscretizerWin
TEMPLATE = app

INCLUDEPATH += ../../Dropbox/Utils/CPP/ \
../../Dropbox/Utils/CPP/tinyxml/

SOURCES += main.cpp \
Interval.cpp \
VisualDiscretizerMainWindow.cpp \
VisualDiscretizerDiscretizationWindow.cpp \
../../Dropbox/Utils/CPP/TextUtils.cpp \
../../Dropbox/Utils/CPP/tinyxml/xmltest.cpp \
../../Dropbox/Utils/CPP/tinyxml/tinyxmlparser.cpp \
../../Dropbox/Utils/CPP/tinyxml/tinyxmlerror.cpp \
../../Dropbox/Utils/CPP/tinyxml/tinyxml.cpp \
../../Dropbox/Utils/CPP/tinyxml/tinystr.cpp

HEADERS += \
Interval.h \
VisualDiscretizerMainWindow.h \
VisualDiscretizerDiscretizationWindow.h \
../../Dropbox/Utils/CPP/TextUtils.hh \
../../Dropbox/Utils/CPP/tinyxml/tinyxml.h \
../../Dropbox/Utils/CPP/tinyxml/tinystr.h \
"C:/Qwt-6.1.0-rc3/include/qwt_plot.h"

FORMS += \
VisualDiscretizer.ui


I get some warnings during the compiling process (qmake <project-file>.pro / mingw32-make):


E:\Research\VisualDiscretizerWin>qmake VisualDiscretizerWin.pro

E:\Research\VisualDiscretizerWin>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'E:/Research/VisualDiscretizerWin'

<snip>

release\moc_qwt_plot.cpp:95:6: warning: 'static void QwtPlot::qt_static_metacall
(QObject*, QMetaObject::Call, int, void**)' redeclared without dllimport attribu
te: previous dllimport ignored [-Wattributes]
release\moc_qwt_plot.cpp:136:28: warning: 'QwtPlot::staticMetaObject' redeclared
without dllimport attribute after being referenced with dll linkage [enabled by
default]
release\moc_qwt_plot.cpp:142:20: warning: 'virtual const QMetaObject* QwtPlot::m
etaObject() const' redeclared without dllimport attribute: previous dllimport ig
nored [-Wattributes]
release\moc_qwt_plot.cpp:147:7: warning: 'virtual void* QwtPlot::qt_metacast(con
st char*)' redeclared without dllimport attribute: previous dllimport ignored [-
Wattributes]
release\moc_qwt_plot.cpp:157:5: warning: 'virtual int QwtPlot::qt_metacall(QMeta
Object::Call, int, void**)' redeclared without dllimport attribute: previous dll
import ignored [-Wattributes]
release\moc_qwt_plot.cpp:208:6: warning: 'void QwtPlot::itemAttached(QwtPlotItem
*, bool)' redeclared without dllimport attribute after being referenced with dll
linkage [enabled by default]
release\moc_qwt_plot.cpp:215:6: warning: 'void QwtPlot::legendDataChanged(const
QVariant&, const QList<QwtLegendData>&)' redeclared without dllimport attribute
after being referenced with dll linkage [enabled by default]
g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\VisualDiscretizerWin.exe
object_script.VisualDiscretizerWin.Release -lmingw32 -lqtmain -LE:\Libs\Qt\Qt5.
0.2\5.0.2\mingw47_32\lib -lQt5Widgets -lQt5Gui -lQt5Core -llibEGL -llibGLESv2 -l
gdi32 -luser32 -LC:/Qwt-6.1.0-rc3/lib -lqwt
mingw32-make[1]: Leaving directory 'E:/Research/VisualDiscretizerWin'


And finally, when I try to run the executable VisualDiscretizerWin.exe in the release sub-folder, I get the dreaded error:

"VisualDiscretizerWin.exe - Entry Point Not Found
The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library libstdc++-6.dll"

Can you help me? Thanks in advance for your time

Santosh Reddy
17th April 2013, 13:42
"VisualDiscretizerWin.exe - Entry Point Not Found
The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library libstdc++-6.dll"
The dll file is not accessable from the release sub-folder, so what you could do is copy the libstdc++-6.dll file to release sub-folder (it can be found in MinGw\bin folder).

Further you need other dlls, copy all the required dlls to release sub-folder

sol_kanar
17th April 2013, 18:45
Thanks! I copied the libstdc++-6.dll file in the folder, and now it's not giving that error anymore.

However, it's getting weirder. After I copied the .dll inside the release folder, the executable crashed with no messages (!) every time I tried to run it, even after recompiling everything :-O The current main.cpp file is:


// main class for the visual discretizer application

// Qt/Qwt classes
#include <QApplication>

// local classes
#include "Interval.h"
#include "VisualDiscretizerMainWindow.h"

using namespace std;

int main(int argc, char* argv[])
{
cout << "Wow, now I am running!" << endl;

// create qt application
QApplication app(argc, argv);

// associate it to main window
QMainWindow* mainWindow = new QMainWindow;
Ui::VisualDiscretizerMainWindow vdMainWindow;

// execute
vdMainWindow.setupUi(mainWindow);

// show window
mainWindow->show();

// return
return app.exec();
}

Do you have any advice?

Santosh Reddy
17th April 2013, 20:13
Can you use the debugger and see where it is crashing.

BTW mainWindow is not being deleted!