logo

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Ajith Kumar  
#1 Posted : Monday, May 11, 2015 9:18:22 PM(UTC)
Ajith Kumar

Rank: Member

Joined: 5/11/2015(UTC)
Posts: 12

Was thanked: 4 time(s) in 4 post(s)
Hi,

I am working on MatrikonOPC_UASDK_Linux.

I have extracted UA_SDK.tar.gz by running Unpack.sh script.

Inside the UA_SDK I could see the following folders like Samples, Include, Documents, Localization, Lib.

Please teach me how to use this SDK, I am new to this SDK.

I have a Customized Gateway board, which has ARM processor. How can I build this SDK on the Gateway board?

Please suggest me in this regard.

Regards,
Ajith
Offline Roberto Dias  
#2 Posted : Wednesday, May 20, 2015 10:58:13 AM(UTC)
Roberto Dias

Rank: Member

Joined: 4/15/2015(UTC)
Posts: 12
Location: Florianópolis

Was thanked: 5 time(s) in 5 post(s)
Hi Ajith,

In the installation folder of UA_SDK we have a Samples folder with SampleUaConsole application with source code.
In the Documentation (api guide) see Lesson 2 for installation and configuration of Eclise Luna IDE for C++ and UA_SDK test.
Based in the Lesson 2 create a new project for SampleUaConsole files. Include .cpp and .h files of SampleUaConsole source files to your project and built application in the Eclipse Luna.

I use SampleUaConsole how a starting point for my personalized initial projects.

Best Regards!

Offline Ajith Kumar  
#3 Posted : Monday, May 25, 2015 4:16:05 AM(UTC)
Ajith Kumar

Rank: Member

Joined: 5/11/2015(UTC)
Posts: 12

Was thanked: 4 time(s) in 4 post(s)
Hi,

Thanks for the reply.

I tried to configure as per the guide lines provided in the API.Guide

This is the sample program as shown below:

Program:

#include <iostream>

using namespace std;

int main() {
cout << "!!!***Hello World UA SDK ***!!!" << endl; // prints !!!***Hello World UA SDK ***!!!
return 0;
}

When I try to build project I am getting the following errors. The errors are mentioned as shown below.

Problems:

cannot find -lClientSdk test1
cannot find -lStackWrapper
cannot find -lGeneralSdk
make: *** [test1] Error 1
skipping incompatible /home/rv00343930/MatrikonOPC_UASDK_Linux/UA_SDK/Lib/libClientSdk.so when searching for -lClientSdk
skipping incompatible /home/rv00343930/MatrikonOPC_UASDK_Linux/UA_SDK/Lib/libStackWrapper.so when searching for -lStackWrapper
skipping incompatible /home/rv00343930/MatrikonOPC_UASDK_Linux/UA_SDK/Lib/libGeneralSdk.so when searching for -lGeneralSdk

I have given the test1 path as /home/rv00343930/Documents/test1.

Please kindly suggest me on how to resolve these errors.

Regards,
Ajith

Edited by user Monday, May 25, 2015 4:17:35 AM(UTC)  | Reason: Not specified

Offline Roberto Dias  
#4 Posted : Wednesday, May 27, 2015 11:00:13 AM(UTC)
Roberto Dias

Rank: Member

Joined: 4/15/2015(UTC)
Posts: 12
Location: Florianópolis

Was thanked: 5 time(s) in 5 post(s)
HI Ajith,

In my application, in the same way of SampleUaConsole executable folder in Samples folder of UA_SDK I have copied
libClientSdk.so.Release.x.x.x.x,libGeneralSdk.so.Release.x.x.x.x and libStackWrapper.so.Release.x.x.x.x to my Debug folder.
This files are located in the Lib folder of UA_SDK.

My application run fine!

Best Regards!
Offline Ajith Kumar  
#5 Posted : Tuesday, June 2, 2015 11:11:22 PM(UTC)
Ajith Kumar

Rank: Member

Joined: 5/11/2015(UTC)
Posts: 12

Was thanked: 4 time(s) in 4 post(s)
Hi,

I have followed the following steps as shown below as I am using 64bit linux ubuntu 14.04 system.

a) sudo apt-get install libc6:i386

b) cd /etc/apt/sources.list.d

c) echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list

d) apt-get update

e) apt-get install ia32-libs

f) rm /etc/apt/sources.list.d/ia32-libs-raring.list

g) apt-get update

h) sudo apt-get install gcc-multilib

and then I have give -m32 after gcc.

but still I am getting the same error as:

cannot find -lClientSdk
cannot find -lStackWrapper
cannot find -lGeneralSdk

I even copied .so libraries in to Debug folder.

Please help me to resolve the error.

Regards,
Ajith
thanks 1 user thanked Ajith Kumar for this useful post.
Offline Patrick Griffiths  
#6 Posted : Wednesday, June 3, 2015 8:34:59 AM(UTC)
Patrick Griffiths

Rank: Advanced Member

Joined: 11/28/2014(UTC)
Posts: 37

Was thanked: 13 time(s) in 11 post(s)
Can you post the gcc command line you are using?

Thanks
Patrick
thanks 1 user thanked Patrick Griffiths for this useful post.
Offline Ajith Kumar  
#7 Posted : Thursday, June 4, 2015 7:00:14 AM(UTC)
Ajith Kumar

Rank: Member

Joined: 5/11/2015(UTC)
Posts: 12

Was thanked: 4 time(s) in 4 post(s)
I am using as:

gcc -m32

gcc --version o/p in linux:

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

Regards,
Ajith
thanks 1 user thanked Ajith Kumar for this useful post.
Offline Patrick Griffiths  
#8 Posted : Thursday, June 4, 2015 8:10:04 AM(UTC)
Patrick Griffiths

Rank: Advanced Member

Joined: 11/28/2014(UTC)
Posts: 37

Was thanked: 13 time(s) in 11 post(s)

That can't be the whole command line.

When gcc says it can't find a library it means just that. The obvious troubleshooting to undertake is to check that the library paths are configured correctly so the linker can find the libraries. The command line option is -L. Off the cuff I don't remember where eclipse hides the option in the CDT UI, but it's there somewhere. You just need to poke around a bit to find it.

First I think you should step back and be sure you aren't fighting a losing battle against an incomplete configuration. Are you sure you have a working compiler that will generate a 32bit executable? Can you compile and run 'Hello World' from the command line? E.g.

hello.cpp:

#include <iostream>
int main(int, char **)
{
std::cout << "Hello, World!" << std::endl;
return 0;
}

Command line:
g++ -Wall -Wextra -g -m32 hello.cpp -o hello32
g++ -Wall -Wextra -g hello.cpp -o hello64

Can you run both? Check the output of each of these commands:

ldd hello32
ldd hello64

All the system libraries should be resolved and both should run.

Once you know your compiler is happy, try linking in the SDK libraries. The code obviously doesn't call any of the UA SDK functions, but this will tell you if the compiler can find the libraries:

g++ -Wall -Wextra -g -m32 hello.cpp -o hello32 -L$HOME/UA_SDK/Lib -lClientSdk -lStackWrapper -lGeneralSdk

NOTE: Replace $HOME/UA_SDK/Lib with the path to the libraries on your machine!

HTH
Patrick

Offline Ajith Kumar  
#9 Posted : Friday, June 5, 2015 5:21:00 AM(UTC)
Ajith Kumar

Rank: Member

Joined: 5/11/2015(UTC)
Posts: 12

Was thanked: 4 time(s) in 4 post(s)
Hi Patrick,

Thank you for the reply.

I tried as suggested, I have created as hello.cpp file and tried to compile as suggested.

I can see hello64 executable being generated.

I am placing the output below for your reference.

hello32:

root@rv00343930-OptiPlex-210L:/home/rv00343930# g++ -Wall -Wextra -g -m32 hello.cpp -o hello32
In file included from hello.cpp:1:0:
/usr/include/c++/4.8/iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.


hello64:

root@rv00343930-OptiPlex-210L:/home/rv00343930# g++ -Wall -Wextra -g hello.cpp -o hello64


ldd hello32:

root@rv00343930-OptiPlex-210L:/home/rv00343930# ldd hello32
ldd: ./hello32: No such file or directory


ldd hello64:

root@rv00343930-OptiPlex-210L:/home/rv00343930# ldd hello64
linux-vdso.so.1 => (0x00007fff3ebfe000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f65ab270000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f65aaeab000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f65aaba4000)
/lib64/ld-linux-x86-64.so.2 (0x00007f65ab594000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f65aa98e000)



root@rv00343930-OptiPlex-210L:/home/rv00343930/MatrikonOPC_UASDK_Linux/UA_SDK/Lib# g++ -Wall -Wextra -g -m32 hello.cpp -o hello32 -L/home/rv00343930/MatrikonOPC_UASDK_Linux/UA_SDK/Lib -lClientSdk -lStackWrapper -lGeneralSdk
In file included from hello.cpp:1:0:
/usr/include/c++/4.8/iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.

Please suggest me in this regard.

Regards,
Ajith

Edited by user Friday, June 5, 2015 7:02:11 AM(UTC)  | Reason: Not specified

Offline Patrick Griffiths  
#10 Posted : Monday, June 8, 2015 7:13:28 AM(UTC)
Patrick Griffiths

Rank: Advanced Member

Joined: 11/28/2014(UTC)
Posts: 37

Was thanked: 13 time(s) in 11 post(s)
Ajith,

You don't have multilib support installed.

Offhand, I don't know the exact list of packages required for Ubuntu 14.04. At the very least you will need g++-multilib and probably lib32stdc++-4.8-dev. You may need others too.

Patrick
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Matrikon Subscribe  |   Matrikon Unsubscribe  |   Global Unsubscribe  |   Privacy Statement  |   Your Privacy Choices   |   Cookie Notice