Link to home
Start Free TrialLog in
Avatar of slavikn
slavikn

asked on

g++, Fatal error: No compiled in support for x86_64

I try to compile:

#include <iostream>
int main(){
        std::cout << "HELLO!!!!" << std::endl;
        return 0;
}

with the following line:
      /usr/bin/g++ -m64 1.cc

I get an error message:
     "Assembler messages:
     Fatal error: No compiled in support for x86_64
     Exit 1"

Please assist,
Thanks.
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Why are you providing -m64 flag? I presume it works without this? Do you need it?
Do you have an x86_64 architecture ? And was your compiler built with support for that architecture ? Also check binutils.

Or are you maybe trying to cross-compile ?
I take it your intent is to achieve the following?

-m64
           "Generate code for a 32-bit or 64-bit environment.  The 32-bit environment sets int, long and pointer to 32 bits.  The 64-bit environment sets int to 32 bits and long and pointer to 64 bits."
Avatar of slavikn
slavikn

ASKER

> Why are you providing -m64 flag? I presume it works without this? Do you need it.

Of course, the program I'm trying to compile isn't "hello world" :-)

> Do you have an x86_64 architecture ?

How do I check this?

> And was your compiler built with support for that architecture ?

It's g++ 4.1.1-52

> Also check binutils.

What's that..?

> Or are you maybe trying to cross-compile ?

What's that..?
From your replies, I gather that you don't know why you use the -m64 flag ... do you ?

Just leave it out and try again ...
Avatar of slavikn

ASKER

It's something needed for work.
We're trying to compile ACE 5.6.2.
>> Of course, the program I'm trying to compile isn't "hello world" :-)
Just checking -- I'd hate to overlook the blindingly obvious ;-)

As Infinity08 has already said, you need to ensure you have installed a version of binutils that can do cross compilation. I was unable to find any definitive documentation on this but the following links may help: -

http://en.wikipedia.org/wiki/Cross_compiler
http://linux.bytesex.org/cross-compiler.html
http://kerneltrap.org/node/4098

>> What's that..?
binutils: http://www.gnu.org/software/binutils/

-Rx.
Avatar of slavikn

ASKER

binutils version = 2.17.50.0.6-2.el5 20061020
Have you checked that version is for x64 cross-compiling?
See when I do apt-cache search on Unbunta for binutils I get the following: -

binutils-avr - Binary utilities that support Atmel's AVR targets.
binutils-h8300-hms - GNU cross assembler for H8/300[HS], linker and binary utilities
binutils-m68hc1x - binary utilities that support Motorola's 68HC11/12 targets
mingw32-binutils - Minimalist GNU win32 (cross) binutils
pocketpc-binutils - The GNU binutils for Pocket PC
binutils - The GNU assembler, linker and binary utilities
binutils-dev - The GNU binary utilities (BFD development files)
binutils-multiarch - Binary utilities that support multi-arch targets

As you can see, there are a number of versions to support different platforms and architectures. You need to ensure you have the correct version installed for the platform/architecture you are targeting. I'm not sure the version number alone will tell you that (as it's likely to just be the version number of that specific flavour).
Avatar of slavikn

ASKER

What command should I run to get the output you provided..?
If you are using a Debian based distro: apt-cache search binutils
Avatar of slavikn

ASKER

uname -a
Linux rhx64cs.mycompany.com 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:14 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
>> > Or are you maybe trying to cross-compile ?
>> 
>> What's that..?

Let me get back to this : if you don't know what cross compiling is, then it's likely that you aren't cross compiling.

Can you tell us why you need the -m64 flag ? What happens if you leave it out ?
>> Linux rhx64cs
So, you need RPMs: http://rpmseek.com/rpm-pl/binutils-64bit.html
Avatar of slavikn

ASKER

We need our software to run on 64-bit machines.
Therefore, we need to compile it (+ ACE) with the -m64 flag.

Does it make sense now?
Avatar of slavikn

ASKER

evilrix, looks like the link contains binutils for SuSE... :(
There seems to be no RedHat specific package, you could try the Fedora one. If you can install the package it means all the dependencies have been met and it will (hopefully) work.
>> We need our software to run on 64-bit machines.
>> Therefore, we need to compile it (+ ACE) with the -m64 flag.

Ah. Now we have something to work on :)


>> > Do you have an x86_64 architecture ?
>> 
>> How do I check this?

Show the output of the command :

        arch

or :

        uname -m

But it seems you do have an x86_64 architecture.

Then, if the system is correctly installed and configured, it should work fine. I always use -march=k8 instead of -m64 though - can you try that ?


fyi, here's the official binutils site :

         http://www.gnu.org/software/binutils/

with links to documentation, and downloads.
>> fyi, here's the official binutils site :
Copy cat :p   {http:#20606746}
ASKER CERTIFIED SOLUTION
Avatar of slavikn
slavikn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> brrrr....... all I had to do is
Sometimes it's the simplest things that are the easiest to overlook :)
>> >> fyi, here's the official binutils site :
>> Copy cat :p   {http:#20606746}

Hey, I've got a short memory ;) Sorry :)


>> brrrr....... all I had to do is:
>> setenv PATH /usr/bin/:$PATH
>> and this solved the problem.

Heh ... Once I knew that your system WAS an x86_64, I was stumped, because you shouldn't have this problem on a correctly configured system (as I said in my previous post). Turns out it wasn't correctly configured ;)

Good that you figured it out !


>> Sometimes it's the simplest things that are the easiest to overlook :)

Exactly ... The world is unfair, isn't it :)
>> Hey, I've got a short memory ;) Sorry :)
No worries, I'm just being a little pedantic (after recent events). I know you are only after providing good service :)

Closed, 150 points refunded.
Vee_Mod
Community Support Moderator