LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2007, 12:22 AM   #1
fsucsguy
LQ Newbie
 
Registered: Apr 2007
Posts: 9

Rep: Reputation: 0
Unhappy 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
 
Old 04-23-2007, 12:43 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
Old 04-23-2007, 11:08 PM   #3
fsucsguy
LQ Newbie
 
Registered: Apr 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Unhappy

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

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I got a error flag "init: /dev/initctl: no such file" mst700 Linux - Newbie 4 10-28-2007 08:00 AM
Is it possible to add additional compile flag into a debian package? Akhran Debian 2 03-10-2006 04:22 PM
mount_smbfs authentication error with -N flag xaenn *BSD 1 11-18-2005 04:49 PM
Failure of gcc -m32 on an x86_64 RockM66 Linux - Software 0 01-19-2005 04:07 PM
gcc -lGLU Flag Gives An Error Chryzmo Slackware 2 09-30-2004 09:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration