Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-03-2012, 05:06 AM
|
#1
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Rep: 
|
xillinux( ubuntu 12.04 LTS based os) for zedboard makes Arith/logic error unlike pc
My cpp project compiles and runs as well successfully with correct results in a linux based pc  . But the same cpp project luckily gets compiled in xillinux platform(ubuntu 12.04 LTS based Linux distribution) on Zedboard(development board with arm cortex a9 dual core processor) but while running it makes a logical error in computation and eventually aborts as its programmed to abort if something goes wrong.
Error:
Assertion fails and then aborts and gets cored dumped.
The assertion is to check a variable's value if its less than or equal to 1. But it gets a value 255 instead 1 or 0 or -1  .
In a PC with centos/ubuntu and intel i3 processor it didn't give 255 ever..!
Gcc compiler version in my PC running centos is:
gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
Gcc compiler version in xillinux (zedboard) is:
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
It seems to be some incompatibility but not sure about the cause. How to get rid of this problem?
Can anyone help me in this please..?
Thanks.
-Mahesh 
|
|
|
11-03-2012, 01:57 PM
|
#2
|
Member
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705
Rep: 
|
If you would post your code, or a fragment of it to illustrate the specifics of the problem, then we could do more than guess.
But without your code, I can only guess that, IF you are using the C language, then you might want to keep in mind that the actual size of some integer data types can vary from machine to machine. So it is certainly possible to write a program which succeeds in making a computation on one machine, but fails on another machine.
You might want to make use of the sizeof operator to display the size of the variables you are using, as you run the program, on each machine.
Also, you might consider making use of more portable data types.
Link to information on C data types
|
|
1 members found this post helpful.
|
11-04-2012, 11:21 PM
|
#3
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
Thanks a lot kakaka for the reply. And i got your point about the portable data types. I will explore into that. Thanks again.
|
|
|
11-07-2012, 05:59 AM
|
#4
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
Quote:
Originally Posted by kakaka
If you would post your code, or a fragment of it to illustrate the specifics of the problem, then we could do more than guess.
But without your code, I can only guess that, IF you are using the C language, then you might want to keep in mind that the actual size of some integer data types can vary from machine to machine. So it is certainly possible to write a program which succeeds in making a computation on one machine, but fails on another machine.
You might want to make use of the sizeof operator to display the size of the variables you are using, as you run the program, on each machine.
Also, you might consider making use of more portable data types.
Link to information on C data types
|
Hi..
In my cpp project, i found a dir called compat and inside that stdint.h is there. In wiki its mentioned that stdint.h will help for data type problems for different cpu architectures. Any idea about how to make use of this? i tried gcc -std=c99 but it complains that c++ cannot be supported with this c99 standard.. any idea about this please...
|
|
|
04-17-2013, 02:07 AM
|
#5
|
LQ Newbie
Registered: Nov 2012
Posts: 4
Original Poster
Rep: 
|
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file
Hi,
I created Boot.bin file for developing xilinx-linux on ZedBoard(Digilent),
Then copied Boot.bin and other files(ramdisk,devicetree,Zimage,zynq_fsbl.elf) to sdcard and
Booted xilinux OS on Zedboard Successfully,
Then i tried to run the simple helloworld.c on this Xilinux-linux of Zedboard using the
ARM Crosscompiler's(arm-xilinux-linux-gnueabi-g++ helloworld.c -o A.out).
On Linux PC i genrated A.out file using the Arm crosscompiler's,then moved this A.out to Zedboard
and ran the A.out executable file xilinx-linux of Zedboard,it's giving helloworld o/p...working fine.
Now i am trying to running my c,c++ codes(more than 5 files) on Xilinux-linux of Zedboard,
For that one i genrated the A.out file on Linux PC using ARM cross compiler's,
Then i tried to ran the this A.out executable on xilinx-linux of ZedBoard.
it giving the following error,
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Then i tried to copied libstdc++.so.6 file to corresponding location on board side,
And also exported path for corresponding /bin and library files,
Still i am facing same problem,
Can Any one provide Solution for solving this error?
Can anyone help me in this please..?
Last edited by mahesh418.g; 04-17-2013 at 02:11 AM.
|
|
|
05-02-2013, 03:18 PM
|
#6
|
Member
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705
Rep: 
|
mahesh418.g,
You might try asking your questions on the forums that exist to help Users of Xilinx products:
http://forums.xilinx.com/
I don't know anything about the particular Linux you are using. But in general, when dealing with cross compiling, there are various ways to do it, two of the major ways are:
1) Have a complete development environment on one platform, with all the libraries compatible with your target platform, and statically link the output files cross-compiled for the target platform, with the libraries for the target platform. Then just copy over the executables which will have no dynamic dependencies on external libraries.
2) Just cross-compile from your source code producing binaries for the target platform with dynamic linking, meaning there will be dependencies on external libraries from the target platform. When you copy over the output binaries, the proper libraries will have to be present on the target platform in order to run the binaries successfully.
So when you copied over the libstdc++.so.6 it was the library for the target platform, yes? It was the libstdc++.so.6 for Xilinx Linux on an ARM based system?
|
|
|
All times are GMT -5. The time now is 07:19 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|