Re: QwtPlot derived class
you could debug and search the code that is responsible for thisaccess violation.
Re: QwtPlot derived class
could you copy your *.cpp?
no errors for me in the declaration
Re: QwtPlot derived class
This is usually a problem of your build/runtime environment and has nothing to do with the code.
Uwe
Re: QwtPlot derived class
Quote:
Originally Posted by
FelixB
you could debug and search the code that is responsible for thisaccess violation.
I wrote: "During startup [...]". That means no code is executed (better, no code visible through debug).
Quote:
Originally Posted by desantossierra
could you copy your *.cpp?
no errors for me in the declaration
No code in the cpp file, but the empty implementation of the constructor:
I've just found I need to remove the Q_OBJECT macro. Without it runs.
Does anyone know why?
Quote:
Originally Posted by
Uwe
This is usually a problem of your build/runtime environment and has nothing to do with the code.
Maybe. But why removing the Q_OBJECT macro it works? It seems code related.
Re: QwtPlot derived class
Usually because your build environment doesn't handle moc and the generated cpp files properly.
Uwe
Re: QwtPlot derived class
Quote:
Originally Posted by
Uwe
Usually because your build environment doesn't handle moc and the generated cpp files properly.
Anyway, this happens only with Qwt. I have several classes that uses Q_OBJECT without problem.
How to handle moc and cpp files properly?
Re: QwtPlot derived class
So that moc is called, whenever the header changes, and the generated cpp file gets compiled and linked.
Uwe
Re: QwtPlot derived class
Isn't this the default behavior? In fact, all classes I write but the Qwt-derived ones work.
Re: QwtPlot derived class
Quote:
Originally Posted by
Marco Trapanese
Isn't this the default behavior?
It depends on your IDE - f.e. MSVC has never heard of something like moc.
Uwe
Re: QwtPlot derived class
Re: QwtPlot derived class
O.k. this one should be fine.
What did you write in your project file: "CONFIG += qwt" ( using a proper installation following the advices from INSTALL ) or did you set the compiler/linker flags manually ?
Uwe
Re: QwtPlot derived class
In my pro file I have the following entry:
Code:
CONFIG(debug, debug|release) {
LIBS += -lqwtd
DESTDIR = debug
} else {
LIBS += -lqwt
DESTDIR = release
}
I thank you for your patience.
Re: QwtPlot derived class
No compiler flags - then you missed to set QWT_DLL.
Uwe
Re: QwtPlot derived class
Ok, I will investigate further on that.
Re: QwtPlot derived class
I had the same issue and I solved it with the advices of this topic: http://www.qtcentre.org/threads/4454...le-auto-import
Quote:
I compiled qwt 6.0.1 dynamic library with qt 4.7.4, and added it to my qt project,
but there is a linking warning saying missing --enable-auto-import option,
I checked the qmake.conf file in mkspecs/win32-g++, QMAKE_LFLAGS is empty,
QMAKE_LFLAGS =
but in qt 4.7.3, QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
so I added the -Wl,-enable-auto-import to qt 4.7.4, it worked.