Problems encountered when compiling 32-bit programs on Ubuntu64

Source: Internet
Author: User
I thought that the source code could be directly compiled on the Ubuntu64bit system. The results also encountered several problems. This is also a backup. 1. Vmware simulated 64-bit system issues. By default, even if the cpu supports 64-bit, intel's vt (visualizationtechnology) is disabled, which is required by Vmware to simulate a 64-bit system, so enable it in bios. I found this answer from the very beginning, but it is followed by restart.

Originally, we thought that we could directly compile the source code on the 64-bit Ubuntu system. The results also encountered several problems. This is also a backup.

1. Vmware simulated 64-bit system issues. By default, even if the cpu supports 64-bit, intel's vt (visualization technology) is disabled, which is required by Vmware to simulate a 64-bit system, so enable it in bios. I found this answer at the beginning, but it won't work after several reboots. I searched it again to find that many people had hidden half of them and did not make it clear. This requires cold start, that is, shutdown and re-opening to take effect.

2. gcc compilation Parameter Problem 1. The error is as follows:

CPU you selected does not support x86-64 instruction set

Cc-I/computer/home/me/fftw-2.1.3/fftw-I/computer/home/me/fftw-2.1.3/rfftw-ansi-O6-fomit-frame-pointer-Wall-W- wcast-qual-Wpointer-arith-Wcast-align-pedantic-fno-schedule-insns-fschedule-insns2-malign-double-fstrict-aliasing-mcpu = pentiumpro-c ftdock. c
Ftdock. c: 1: error: CPU you selected does not support x86-64 instruction set
Ftdock. c: 1: error:-malign-double makes no sense in the 64bit mode

Is it true that 64-bit support is enabled? Later I know, need to modify the value of the makefile surface-march, for example here we need to change to-march = x86-64, so you can. Some documents say that you want to change it to m64. This should be related to the specific system. In Ubuntu 9.0.4, there is no problem with this change.

3. gcc compilation Parameter Problem 2. During the next compilation, a more strange error was reported:

"Relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object ;"

Google is quite common. This requires that the parameter-fPIC be added to the gcc. The-fPIC parameter declaration link library code segment can be shared, but I don't know why the error is not caused by it. Remember it, and try again later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.