Работаем с qwt (Линковщик не видит ни чего)

Модератор: Модераторы разделов

TwisT
Сообщения: 265
ОС: Debian

Работаем с qwt

Сообщение TwisT »

Нужно вобщем графики разные строить, умные люди подсказали qwt. Скачал 5 и 4 версию. Собрал ее в РПМ и поставил.Примеры работают но если попытатся собрать свою прогу он ругается(в винде тоже) и выдает следующее.



link /NOLOGO delayimp.lib /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:windows /LIBPATH:"C:\Qt\3.3.4\lib" /OUT:plot.exe @C:\DOCUME~1\9335~1\LOCALS~1\Temp\nma01020.
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from comdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from oleaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winmm.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from wsock32.dll
LINK : warning LNK4199: /DELAYLOAD:winspool.dll ignored; no imports found from winspool.dll
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::setCurveData(long,double const *,double const *,int)" (?setCurveData@QwtPlot@@QAE_NJPBN0H@Z)
main.obj : error LNK2001: unresolved external symbol "public: long __thiscall QwtPlot::insertCurve(class QString const &,int,int)" (?insertCurve@QwtPlot@@QAEJABVQString@@HH@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall QwtPlot::QwtPlot(class QString const &,class QWidget *,char const *)" (??0QwtPlot@@QAE@ABVQString@@PAVQWidget@@PBD@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::clear(void)" (?clear@QwtPlot@@QAEXXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::removeCurve(long)" (?removeCurve@QwtPlot@@QAE_NJ@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::removeCurves(void)" (?removeCurves@QwtPlot@@QAEXXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::removeMarker(long)" (?removeMarker@QwtPlot@@QAE_NJ@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::removeMarkers(void)" (?removeMarkers@QwtPlot@@QAEXXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setLegendPosition(enum QwtPlot::Position)" (?setLegendPosition@QwtPlot@@QAEXW4Position@1@@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: enum QwtPlot::Position __thiscall QwtPlot::legendPosition(void)const " (?legendPosition@QwtPlot@@QBE?AW4Position@1@XZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setLegendFont(class QFont const &)" (?setLegendFont@QwtPlot@@QAEXABVQFont@@@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: class QFont const __thiscall QwtPlot::legendFont(void)const " (?legendFont@QwtPlot@@QBE?BVQFont@@XZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setAutoLegend(bool)" (?setAutoLegend@QwtPlot@@QAEX_N@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::autoLegend(void)const " (?autoLegend@QwtPlot@@QBE_NXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::enableGridY(bool)" (?enableGridY@QwtPlot@@QAEX_N@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::gridYMinEnabled(void)const " (?gridYMinEnabled@QwtPlot@@QBE_NXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::gridYEnabled(void)const " (?gridYEnabled@QwtPlot@@QBE_NXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::enableGridX(bool)" (?enableGridX@QwtPlot@@QAEX_N@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::gridXMinEnabled(void)const " (?gridXMinEnabled@QwtPlot@@QBE_NXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::gridXEnabled(void)const " (?gridXEnabled@QwtPlot@@QBE_NXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setTitleFont(class QFont const &)" (?setTitleFont@QwtPlot@@QAEXABVQFont@@@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: class QFont __thiscall QwtPlot::titleFont(void)const " (?titleFont@QwtPlot@@QBE?AVQFont@@XZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setTitle(class QString const &)" (?setTitle@QwtPlot@@QAEXABVQString@@@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: class QString __thiscall QwtPlot::title(void)const " (?title@QwtPlot@@QBE?AVQString@@XZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::enableAxis(int,bool)" (?enableAxis@QwtPlot@@QAEXH_N@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::axisEnabled(int)const " (?axisEnabled@QwtPlot@@QBE_NH@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setCanvasLineWidth(int)" (?setCanvasLineWidth@QwtPlot@@QAEXH@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: int __thiscall QwtPlot::canvasLineWidth(void)const " (?canvasLineWidth@QwtPlot@@QBEHXZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setCanvasBackground(class QColor const &)" (?setCanvasBackground@QwtPlot@@QAEXABVQColor@@@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: class QColor const & __thiscall QwtPlot::canvasBackground(void)const " (?canvasBackground@QwtPlot@@QBEABVQColor@@XZ)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPlot::setAutoReplot(bool)" (?setAutoReplot@QwtPlot@@QAEX_N@Z)
moc_qwt_plot.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtPlot::autoReplot(void)const " (?autoReplot@QwtPlot@@QBE_NXZ)
moc_qwt_legend.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtLegend::setReadOnly(bool)" (?setReadOnly@QwtLegend@@QAEX_N@Z)
moc_qwt_legend.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QwtLegend::isReadOnly(void)const " (?isReadOnly@QwtLegend@@QBE_NXZ)
moc_qwt_push_button.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPushButton::setTextFormat(enum Qt::TextFormat)" (?setTextFormat@QwtPushButton@@QAEXW4TextFormat@Qt@@@Z)
moc_qwt_push_button.obj : error LNK2001: unresolved external symbol "public: enum Qt::TextFormat __thiscall QwtPushButton::textFormat(void)const " (?textFormat@QwtPushButton@@QBE?AW4TextFormat@Qt@@XZ)
moc_qwt_push_button.obj : error LNK2001: unresolved external symbol "public: int __thiscall QwtPushButton::alignment(void)const " (?alignment@QwtPushButton@@QBEHXZ)
moc_qwt_push_button.obj : error LNK2001: unresolved external symbol "public: void __thiscall QwtPushButton::setIndent(int)" (?setIndent@QwtPushButton@@QAEXH@Z)
moc_qwt_push_button.obj : error LNK2001: unresolved external symbol "public: int __thiscall QwtPushButton::indent(void)const " (?indent@QwtPushButton@@QBEHXZ)
plot.exe : fatal error LNK1120: 39 unresolved externals

Если может кто нить обьяснить как нужно настроить переменные PATH и LD_LIRARY_PATH.
Linux user #432536.
Спасибо сказали:
CompoVod
Сообщения: 27

Re: Работаем с qwt

Сообщение CompoVod »

Под win - не знаю, но под linux у меня qwt нормально работал. Я, правда, много с ним не общался.

Какая версия qwt и qt? Как собираешь, каким компилятором? В qmake у своей программы чего написано?

В LD_LIBRARY_PATH должна быть директория, где лежит qwt (libqwt), если она в нестандартом месте (не /lib, /usr/lib,...).
Спасибо сказали:
TwisT
Сообщения: 265
ОС: Debian

Re: Работаем с qwt

Сообщение TwisT »

qwt 4.2.0 и 5.0.0 но обе ведут себя одинаково. qt3.3.4, как стояла по умолчанию так и стоит.
Собираю все g++, в 3 захода

qmake -project
qmake
make

Собрал я РПМ, поставил, посмотрел чтобы все лежало вместе с qt, вроде все ОК. И либу положил /usr/lib на всякий случай. Компилится все нормально а при сборке ругается сильно.

Вот что интересно, заглянул я в мейкфайл а там HEADERS +=
и с остальными тоже самое +=

Если не напряг раскажи как свою ставил.

ЗЫ: Засунул я свой проект в папку с qwt и все собралось, но бинарник полметра весит. А после этого собиратся вобще ничего не хочет.
Linux user #432536.
Спасибо сказали:
CompoVod
Сообщения: 27

Re: Работаем с qwt

Сообщение CompoVod »

TwisT писал(а):
05.05.2006 14:13
qwt 4.2.0 и 5.0.0 но обе ведут себя одинаково. qt3.3.4, как стояла по умолчанию так и стоит.

qwt 4.x.x я ставил под qt3.3.5 и из debian'овского репозитария. Поэтому оно само поставилось куда надо и как надо :)
А qwt 5.0.0 - собирал, но под qt4 (4.1.1).

Собирал по их инструкции (только вместо qmake - qmake-qt4, т.к. стояли обе версии qt и qmake по умолчанию был от qt3), потом скопировал все libqwt.* (libqwt.so, libqwt.so.5, libqwt.so.5.0.0) в /usr/lib Заголовки - в /usr/include/qwt (или они сами туда скопировались - не помню).
При сборке использовал примерно такой .pro - файл:

Код: Выделить всё

TEMPLATE    = app
CONFIG        += qt

CONFIG        += thread
CONFIG        += warn_on
CONFIG        += release

MOC_DIR        = moc
OBJECTS_DIR    = obj
INCLUDEPATH    += /usr/include/qwt

unix:LIBS    += -L/usr/lib -lqwt

TARGET        = top

HEADERS        = top.h top_plot.h CExtFinder.h
SOURCES        = top.cpp top_plot.cpp CExtFinder.cpp


Есть подозрение, что дело в строчке LIBS (если -lqwt не указана, программа, возможно, просто не линкуется к ней).

Вот что интересно, заглянул я в мейкфайл а там HEADERS +=
и с остальными тоже самое +=

Если имеется в виду .pro от qmake'а - то все правильно.
А в Makefile, по-моему, такого синтаксиса не может быть...
Спасибо сказали:
Аватара пользователя
alastor
Сообщения: 844
Статус: ARCH'еноид
ОС: Arch Linux current

Re: Работаем с qwt

Сообщение alastor »

Посмотри проектный файл в qwt examples - по аналогии добавь строчки себе в .pro файл (они там юзают еще и examples.pri, посмотри и его). В винде был косяк в заголовочных файлах. Че-то там с хэш функциями. Правится легко. Если такая проблемавозникнет, скажи, вспомню чего правил.
Спасибо сказали:
TwisT
Сообщения: 265
ОС: Debian

Re: Работаем с qwt

Сообщение TwisT »

Всем большое спасибо, проблем решил (убил так сказать 2 зайцев сразу)
Для Линуха удалил все старые поползновения
, собрал либу заново,
кинул содержимое /include в /etc/include/qwt/
libqwt* в /etc/lib/

для проэкта все как всегда
qmake -project
qmake

Теперь в Makefile
Для ЛИНУХА:[size=3]
дописываем строчку -lqwt
Для винды:
дописываем строчку "qwt.lib"

и все (как говорит один мой друг) чики-пуки....

to alastor:
Чем собираешь qt в винде?
Linux user #432536.
Спасибо сказали:
Аватара пользователя
alastor
Сообщения: 844
Статус: ARCH'еноид
ОС: Arch Linux current

Re: Работаем с qwt

Сообщение alastor »

2 TwisT - MinGW, опенсорсная версия без бубна больше ничем не собирается :)
Спасибо сказали: