Results 1 to 10 of 11
I have compiled a simple c++ program and made an exe file in my computer (i686). now, I want to use on another computer(i586). It gives me " floating point ...
- 07-12-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 12
Runing an (c++)exe file on different linux computer
I have compiled a simple c++ program and made an exe file in my computer (i686). now, I want to use on another computer(i586). It gives me " floating point exception" error!
I know I should make an exe file compatible with i586, but how? I tried to use -mtune command but it gives me the "command not found ".
Please tell me how to change the arch option in my compiler or give me some key words to search! I couldn't find useful information in google!
Best,
Sh
- 07-12-2010 #2
http://www.linuxforums.org/forum/red...ile-linux.html
the information was given to you in your other thread, you need to pass that argument to g++ when you compile your program
- 07-12-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 12
Noo!! they told me to use the -mtune or -march commands but these commands doeasn't work!
As I explained, when i use these commands, it gives me bace command not found!
- 07-12-2010 #4Maybe you should explain again. There are a number of argumentsAs I explained, when i use these commands, it gives me bace command not found!
to the compiler that will help specify what processor you want to run
the program on. When you use one of these, do you get error messages
from the compiler? If the program compiles OK, does it run OK on
the machine you are compiling on and fail on the other machine?
What commands are you using to compile?
- 07-13-2010 #5Just Joined!
- Join Date
- Jun 2010
- Posts
- 12
Haah! I am new in linux and I made a mistake! I entered -mtune instead of gcc -mtune!
-mtune command with out gcc is incorrect and it gave me "command not found" !!!!! Sorry
You understood my problem mr/s rcgreen.
(my problem is or was: I can compile "hello world " C code using gcc and make a.out on my computer. I also can run a.out on my computer but when I move a.out to another linux machine " board" I can't run it. when I want to run a.out file using this command "./a.out", It gives me " floating point exception" error!
And Mr/s Green told me :
Since my linux systems architecture are different, I should make a an exe file compatible with the target machine, using -mtune and I didn't know how to use -mtune! but now, I know how to use it
)
by the way, thanks a lot .Tomorrow I will check it again
- 07-14-2010 #6Just Joined!
- Join Date
- Jun 2010
- Posts
- 12
Help again
Although I changed the gcc option using " gcc -mtune=i586 program-name" command and created an exe file compatible with target cpu, it gives me " floating point exception" error when I want to run the exe code on target Linux board!!!!!
I am frustrated!!!! My program is just a main function and do nothing!!!!!!! I don't know why an exe file can't be run on different systems!!!
my computer is i686 (I think with Fedora) and my board is i586 (with pyramid).
- 07-14-2010 #7
Maybe this is a dumb question. Does it run OK on the computer
you compiled it on? Maybe you should post your code. It might
have a bug.
- 07-15-2010 #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
Try -mtune=i386 instead of 586 (lower common denominator). It may still fail since the i386 will require software math libraries to be available. i586 is a low-end pentium and it will have hardware math, though it is possible that your embedded system does not have such. Can you post the specs of your board?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-15-2010 #9Just Joined!
- Join Date
- Jun 2010
- Posts
- 12
Yea, I am sure that it has no bug. I compiled 2 programs:
1- hello world program. When I run its exe file in my computer, I can see "hello world" expression in the terminal! (the result that I want)
2- an empty main function without any include and any commands!. I can make exe file without any error and when I run it in my computer, I see no error!
When I move the exe files of these 2 simple codes to my board and I want to run them, I see " floating point exception" error!!! I have no arithmetic operation in my code and they are really simple! I don't know whats wrong!
I will check the exe files on another computer so that I find out which one has problem, my boards or exe files!!!
Thank you very much for your help!
- 07-15-2010 #10Just Joined!
- Join Date
- Jun 2010
- Posts
- 12


Reply With Quote
