LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   g++ gives an ld error when I compile with -m32 flag. (https://www.linuxquestions.org/questions/linux-software-2/g-gives-an-ld-error-when-i-compile-with-m32-flag-548202/)

fsucsguy 04-23-2007 12:22 AM

g++ gives an ld error when I compile with -m32 flag.
 
I'm running a 64-bit RHEL5 with g++-version 3.4.3

My main.cpp file is nothing more than a main() as follows ...
Code:


#include <iostream>

using namespace std;

int main()
{
  return 0;
}

and when I try to compile as:
g++ -m32 main.cpp

it gives me an ld error as follows...
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status


any idea why this might be happening, and how to compile as a 32 bit ...

any help is greatly appreciated... thanks for looking

btmiller 04-23-2007 12:43 AM

Taking a bit of a guess, but do you have 32 bit versions of the C++ standard libraries installed? I'm guessing it's trying to find them to link against and failing. If you only have a 64 bit version of the C++ standard library you will need to install a 32 bit version.

fsucsguy 04-23-2007 11:08 PM

So, will I have another /usr/bin/g++ like /usr/bin/g++32?

I'm thinking that I should have the 32 bit libraries?


All times are GMT -5. The time now is 06:40 PM.