Results 1 to 10 of 14
Hi,
I developed a c++ program on a centos(Red-Hat based) computer which I'm trying to run on a Voyage-Linux(Debian-based) computer.
The program compiles and runs fine on my centos. It ...
- 08-27-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 72
Floating point exception / Compiling a c++ program
Hi,
I developed a c++ program on a centos(Red-Hat based) computer which I'm trying to run on a Voyage-Linux(Debian-based) computer.
The program compiles and runs fine on my centos. It also runs fine on my iMedia embedded linux computer.
On the Voyage-Linux when I run the program it saysI figured I needed to compile my program on my Voyage-Linux but I have no graphic tools to do so and I'm not quite sure how to do it "by hand".Code:Floating Point Exception
I was able to do it with a simple hello world program which is only 1 cpp file by doing, but my project has several cpp and h files and I havn't found a lot of information about accomplishing that kind of task.Code:gcc helloworld.cpp -o helloworld
Am I heading in the correct direction?
If so how should I do it?
If not what else could be done?
Thanks.
Olivier.
- 08-27-2009 #2
How are you building it on your centos computer? The defacto standard is to use makefile's. I'm going to go out on a limb here and guess your voyage linux and centos computers are running different processor architectures, which would explain why the binary wouldn't just run (assuming all the required libs are there too)
- 08-27-2009 #3Just Joined!
- Join Date
- May 2009
- Posts
- 72
I'm using KDevelop on my Centos to develop, and the "build project" menu option does it all for you. I believe it runs automake, configure and compiles the project.
I'm not sure about the processors but the programs ran fine with my iMedia distro on the same machine I'm using for the Voyage distro.
I'm pretty sure all the libraries are there since I installed the build-essential package.
I know there are Makefiles involved but I don't know how to generate them or do what in what order...
- 08-27-2009 #4
i will simplify my question, is the voyage distro 32 or 64 bit? and what is the centos?
- 08-27-2009 #5Just Joined!
- Join Date
- May 2009
- Posts
- 72
Both 32 bit
- 08-27-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I assume you simply copied the executable to the new system? If so, then it is likely that your shared libraries are not compatible, unless you built it statically (no shared libraries).
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-28-2009 #7Just Joined!
- Join Date
- May 2009
- Posts
- 72
You are right I just copied the executables.
- 08-28-2009 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Then you likely have an incompatibillity with the shared libraries used. In order to get an executable to run on systems other than ones very closely compatible with the one you built it on, then you need to tell the linker to do static linking so that shared libraries are not used. In such a case, as long as the kernel versions of the systems are close, then you should be ok. The resulting executable will be larger, but it will run on more target systems.
Normally, people build the software on the target system in order to avoid this situation.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-28-2009 #9Just Joined!
- Join Date
- May 2009
- Posts
- 72
I don't know how to do static linking but I'll see what I can figure out.
As far as building the software on the target system which I was able to do it but that is a challenge for me too.
Thanks for the info.
- 08-28-2009 #10
which I think brings us back to OP's other question, which was how to build the application on this machine. I'm surprised if kdevelop does all those other things for you that there isn't some way to generate a makefile for it or a configure script, etc.


Reply With Quote
