Compiling EWO under linux

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

Compiling EWO under linux

Post by CyaNn »

Hello there,

I am trying to compile an EWO component I wrote under Linux CentOS
I have installed the WinCC3.10 RPMs Core and API packages and created the needed API_ROOT and PLATFORM env variable
Unfortunately it does not seems to work any more.
The problem is, the linker does not find the LibEWO.so file. It does not appears in the /opt/WinCC/3.10/api/lib.linux folder.
Where is the mistake (on widows the LibEWO.dll exists under api/lib.winnt)

So please help me ! I am out of my mind. :(

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

Re: Compiling EWO under linux

Post by mkoller »

What version of CentOS are you running on ?
If it's a newer version than we did support at the days when 3.10 came out, then you're probably seeing an error message while installing the rpm.
E.g. when I try to install it on my current openSuse 42.2 and using a new kernel (4.9.10) I get the following error when installing WinCC_OA_3.10-api-2-0.i386.rpm
** ERROR: linux 4.9 not supported any more
MACHINE=x86_64
RELEASE=4.9.10-2.gffeeef5-default
SYSTEM=Linux
VERSION=#1 SMP PREEMPT Thu Feb 16 08:36:29 UTC 2017 (ffeeef5)
GCC=4.8.5
This is coming from /opt/WinCC_OA/3.10/api/platform
For whatever reason it checks the kernel version, which is too new here.
That then leads to not returning a useful PLATFORM and in the scriptlet in the rpm, the creation of the symlinks is not done.
You can try to create the symlinks on your own:

cd api/lib.linux
ln -f -s ../../bin/lib*.so .
ln -f -s ../../bin/libewo.so.* libewo.so

for i in \\
libQtSql*.so.4 \\
libQtGui*.so.4 \\
libQtXml*.so.4 \\
libQtCore*.so.4 \\
libQtOpenGL*.so.4 \\
libQtNetwork*.so.4 \\
libQtSvg*.so.4 \\
libQt3Support*.so.4
do
ln -f -s ../../bin/${i} `basename ${i} .4`
done

and set PLATFORM to linux

I haven't tried that now, but it should work or give you a hint how to continue.

P.S.:you can check the scriptlet in the rpm by
rpm -qp --scripts WinCC_OA_3.10-api-2-0.i386.rpm

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

Re: Compiling EWO under linux

Post by CyaNn »

Thank you a lot Martin, compilation works great now !

Unfortunately I experience another problem with this ewo.
I have compiled the ewo and copy the libDataGrid.so.1.0.0 lib to the /bin/widgets/linux/ of my project. I rename it to Datagrid.ewo
But when I load it in the gedi it give me this warning :

PVSS00ui (1), 2017.03.15 16:34:14.745, 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: _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE
PVSS00ui (1), 2017.03.15 16:34:14.745, 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"

And EWO gives an error message
Image
Attachments
Screenshot_from_2017_03_15_16_37_44.png

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

Re: Compiling EWO under linux

Post by mkoller »

This one "undefined symbol: _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE"
=> c++filt _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE
BaseExternWidget::signalInterface(QString const&, QList&) const

Can it be that you have declared the signalInterface() in your class but did not implement it ?
(I'm still confused by the fact that it says BaseExternWidget::signalInterface() and not your class name here ...)

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

Re: Compiling EWO under linux

Post by CyaNn »

Hello, thank you for your help.

I have exactly the same error when I create a new EWO from script (newEWO.sh)
So it is not a problem from my program.

Code: Select all

PVSS00ui     (1), 2017.03.16 10:40:43.544, SYS,  WARNING,   133, Could not load shared library /home/ycaron/project/Test/Test/bin/widgets/linux/TestEWO.ewo, /home/ycaron/project/Test/Test/bin/widgets/linux/TestEWO.ewo: undefined symbol: _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE
PVSS00ui     (1), 2017.03.16 10:40:43.544, SYS,  WARNING,    36/uim, The EWO "/home/ycaron/project/Test/Test/bin/widgets/linux/TestEWO.ewo" is version "1", but we can only load version "3"
So I have 2 question :
Can the problem come from the license ? The dongle does not work properly yes, I will investigate that.
Can the problem come from the version of CentOS I use (CentOS 7 64 bits) ? If it is the case I can have try with a virtual machine.

Thank you again form your great help.

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

Re: Compiling EWO under linux

Post by mkoller »

> Can the problem come from the license ?

no

> Can the problem come from the version of CentOS I use (CentOS 7 64 bits) ?

can be. WinCC_OA 3.10 was only delivered as 32bit compiled. Are you using a 32bit compiler with all libs 32 bit?
Probably the compilation somehow uses the wrong files.
Also please note that CentOS 7 is way younger than when we delivered 3.10. Maybe there are other library version problems, too.

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

Re: Compiling EWO under linux

Post by CyaNn »

Ok, thank you. I will try to install a centos 32 bits on virtual box to test.

Another last question. The version of Qt is 4.6.3 is it ok ? On Windows I compile with the 4.7 version and it works fine.

Thank you again for your great help.

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

Re: Compiling EWO under linux

Post by mkoller »

As long as you are not using Qt features which are not available in 4.6.3, you can use also a newer 4.x Qt version, since Qt guarantees binary upwards compatibility.

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

Re: Compiling EWO under linux

Post by CyaNn »

I experienced the same issue with :
CentOS 6 X86 and WinCCOA 3.10
I have created a new EWO with the script and compil it with QT 3.6 and it gives the same error message :

PVSS00ui (1), 2017.03.21 10:01:17.635, SYS, WARNING, 133, Could not load shared library /home/cyann/projects/winccoa/LinuxEWO_POC/bin/widgets/linux/DataGrid.ewo, /home/cyann/projects/winccoa/LinuxEWO_POC/bin/widgets/linux/DataGrid.ewo: undefined symbol: _ZNK16BaseExternWidget15signalInterfaceERK7QStringR5QListIN8QVariant4TypeEE
PVSS00ui (1), 2017.03.21 10:01:17.636, SYS, WARNING, 36/uim, The EWO "/home/cyann/projects/winccoa/LinuxEWO_POC/bin/widgets/linux/DataGrid.ewo" is version "1", but we can only load version "3"


What mean the version 1 VS version 3 ?

Thank you in advance for your help.
Yann

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

Re: Compiling EWO under linux

Post by mkoller »

"I have created a new EWO with the script and compil it with QT 3.6"

That is the wrong Qt version. In 3.10 we use Qt 4.7.0

"What mean the version 1 VS version 3 ?"

Look into BaseExternWidget.hxx and you'll find a define, e.g.
#define EWO_VERSION "4"

An EWO gets a generated function which allows us to know against which API version it was developed:
That part in BaseExternWidget.hxx
const char *getVersionString() \\
{ return EWO_VERSION; }

When we can load the ewo, this function is called and the returned string is compared to the expected one.
When the ewo can not be loaded, we assume that it's from version "1" since in this version we did not have the getVersionString() function
(it was added with version "2")

25 posts • Page 1 of 3