0

Recently I am doing a C++ project in Linux.I have executable file in Linux. I tried to run it and there showed an error: can not excute binary file. I saw similar questions here in SO and they said this situation happened when people tried to run a x86 program in an ARM CPU. But the problem is I am using an intel i5 3230m cpu and this should be x86 architecture. Quite strange.

There is another issue which I think might be related to this. When I install the Linux system in WMware player. Initially I tried to install the Centosx86_64 but failed(my laptop should be a 64bit system). I had to switch to Centosi386 to get it done.So it this also related to the version of WMware Player?

Can someone help me a little bit about this? Thank you!

Update: Ok ,I tried to use file and I get this is a 64bit file.( ELF 64-bit LSB executable,x86-64,version 1(GNU/Linux), dynamically linked(uses shared libs), for GNU/Linux 2.6.24, not stripped ) And just now I tried lscpu(). What a surprise it shows architecture :i686 cpu op-mode:32bit. How could this happen? My processor is 32 bit architecture?!

  • You haven't said what your host system is, but if it's 32-bit then you can't run 64-bit programs either natively or in a VM. If you remember Windows 3 (a 16-bit operating system) there was an extension which allowed you to run 32-bit programs. Sadly, no-one has done the same thing to allow 64-bit programs to run on a 32-bit OS, though I can't see that the problem is any greater. Your only solution is to install a 64-bit host. – AFH Dec 18 '14 at 22:48
  • Did you compile the executable file from the source code on the same Linux installation where you are trying to run it? – Ale Dec 18 '14 at 22:48
  • My host system is 64 bit windows system and X64-based processor(I can see that form the property of system). This is a new laptop I bought last year with 6 GB RAM. I always thought this is 64 bit, how could it happen that now I am told this is 32 bit? – user3833612 Dec 18 '14 at 22:52
  • @AFH: Win32s had many limitations compared to a real 32-bit version of Windows. And it required, anyway, a physical 32-bit CPU. As 64-bit Linux is easily available, such a 64-bit environment for 32-bit Linux (probably with as many restrictions about what it can run as Win32s had) would just be lots of work to develop and maintain, while there is a much simpler alternative readily available. – Ale Dec 18 '14 at 22:55
  • @user3833612 It tells you 32-bit probably because you have a 32-bit version of Linux installed. Can you check your CPU type (cat /proc/cpuinfo)? So you can be sure you indeed have a 64-bit one. – Ale Dec 18 '14 at 22:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.