Compiling EWO under linux

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
25 posts • Page 2 of 3
CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Compiling EWO under linux

Post by CyaNn »

Ho, excuse me, the QT version I use is 4.6.... sorry. But you said before that 4.x was ok no ?

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Compiling EWO under linux

Post by mkoller »

Yes, correct. 4.6 is ok.
Please make sure you add the following to your .pro file - in case you missed my other posting:

unix: DEFINES += "QT_LIBINFIX=WinCC_OA" "QT_NAMESPACE=WinCC_OA" QT_NO_VERSION_TAGGING

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Compiling EWO under linux

Post by CyaNn »

It does not works better on both machines (CentOS7x64 et CentOS6x86)

I have no idea about what to do to go further !

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Compiling EWO under linux

Post by mkoller »

ok, let's see.
You say you get the error with missing symbol: _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE
which is BaseExternWidget::signalInterface(QString const&, QList&) const
but in fact it should be _ZNK16BaseExternWidget15signalInterfaceERKN8WinCC_OA7QStringERNS0_5QListINS0_8QVariant4TypeEEE
which is BaseExternWidget::signalInterface(WinCC_OA::QString const&, WinCC_OA::QList&) const

So what you see is that in your case there is no WinCC_OA namespace used, but we compiled our Qt library with this namespace.
Therefore it is essential that you use the
DEFINES += "QT_LIBINFIX=WinCC_OA" "QT_NAMESPACE=WinCC_OA"
in your .pro file.
Please double check that you have that and that the resulting Makefile also contains defines like this.

P.S.: is this an enhancement of an existing project or what's th reason you're using this already old version 3.10 ?

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Compiling EWO under linux

Post by CyaNn »

Yes, I have add the DEFINE line your suggested on my PRO file.
It works fine with a blank generated ewo project, but not with mine.
I suppose having something wrong on my project (library or something like that, I will investigate.... perhaps the usage of ui forms and gui library).

I use 3.10 for an existing project, but I can migrate it to a new version of WinCC.
You suggest that the new version of WinCC will resolve the problem ?
I suppose yes because of native 64bits architecture. No ?

Thank again for your help.
Yann

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Compiling EWO under linux

Post by mkoller »

The new version will not solve problem alone since the circumstances are still unclear and we still use the namespaced Qt.
The difference is just that it might be easier for you to directly use and compile on the 64bit cpu, but please also note that in 3.15 we're already using Qt 5.5.0

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Compiling EWO under linux

Post by CyaNn »

I have investigated the problem.
It seems to come from inheritance. When I override a method from a parent object, it gives the following error :

Code: Select all

PVSS00ui     (1), 2017.03.28 16:13:15.851, SYS,  WARNING,   133, Could not load shared library /home/ycaron/project/Test/Test/bin/widgets/linux/Datagrid.ewo, /home/ycaron/project/Test/Test/bin/widgets/linux/Datagrid.ewo: undefined symbol: _ZN8WinCC_OA19QAbstractProxyModel11setItemDataERKNS_11QModelIndexERKNS_4QMapIiNS_8QVariantEEE
PVSS00ui     (1), 2017.03.28 16:13:15.851, SYS,  WARNING,    36/uim, The EWO "/home/ycaron/project/Test/Test/bin/widgets/linux/Datagrid.ewo" is version "1", but we can only load version "3"
The code is the following:

Code: Select all

class SortFilterProxyModel: public QSortFilterProxyModel
{
//    Q_OBJECT
public:
    SortFilterProxyModel(QObject *parent = 0);

protected:
    bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
}

SortFilterProxyModel::SortFilterProxyModel(QObject *parent) :
    QSortFilterProxyModel(parent), _filter(NULL)
{
}

// HERE is the ERROR, if I put the following line in comment it works !
bool SortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
}

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Compiling EWO under linux

Post by mkoller »

I don't see the connection here since the undefined symbol is:
WinCC_OA::QAbstractProxyModel::setItemData(WinCC_OA::QModelIndex const&, WinCC_OA::QMap const&)

2 things:
- check that you do not use forward declarations of Qt classes (class Qxxxxx;) but always use #include
- if you have that already, can you just post your complete code so that I can try locally ? (If you don't want to share it here, just get in contact with our support crew and send it to them)

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Compiling EWO under linux

Post by CyaNn »

Thank you a lot Martin,

Here is the project I try to compile.
To focus the problem, some errors come from Filter/SortFilterProxyModel

https://www.winccoa.com/fileadmin/image ... taGrid.zip

Another problems come from Filter/FilterWidget

It can be fixed by adding the last optional parameter to the Constructor :

Code: Select all

explicit FilterWidget(const FilterElement* filter, QWidget *parent = 0, Qt::WindowFlags f = 0);

FilterWidget::FilterWidget(const FilterElement* filter, QWidget *parent, Qt::WindowFlags f)
    : QWidget( parent, f ), _filter(filter) // ....

This error is my fault. I forgot to add the optional parameter when I override the constructor.
Attachments
DataGrid.zip
(148.58 KiB) Downloaded 201 times

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Compiling EWO under linux

Post by mkoller »

I think I found the problem.
With which version of Qt are you actually building (/usr/include/QtGui/qabstractproxymodel.h) ?

In fact the version 4.7.0 we are using does not include the method setItemData in QAbstractProxyModel
but only in its baseclass

see http://doc.qt.io/archives/qt-4.7/qabstr ... model.html

The method was added in 4.8 though. This means if you compile by using 4.8 Qt headers but then run 4.7 libraries,
it will not find the method.

To solve this, either install the 4.7 headers or upgrade WinCC_OA to a newer version which also uses an newer Qt version.
I compiled your code with 3.11 and also 3.12 - all worked (64 bit)

25 posts • Page 2 of 3