LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2002, 02:52 PM   #1
srkherad
LQ Newbie
 
Registered: Oct 2002
Posts: 17

Rep: Reputation: 0
Unhappy problem calling gcc from another dir (please help)


Hi linux experts,

I'm having a small problem. let me first explain my situation.

I downloaded a multiprocessor simulator called LIMES. i also downloaded gcc 2.6.3 from the LIMES homepage b/c it requires that version and in my redhat 7.3 linux i have gcc 2.95.

all this is done in a terminal:
so i unzip everything and place LIMES in /home/limes and gcc2.3.6 in /usr/local/oldgcc. next i edit several makefiles for LIMES to redirect it to look into /usr/local/oldgcc. next i go into /home/limes/applications/fft and run make to build a fft program. however, i am given an error that the binary file (gcc) could not be executed. so what i do is build a hello world function called test.c then i call
% /usr/local/oldgcc/usr/bin/gcc test.c
well this again gives me the same error that the binary file could not be executed.
so i cd into /usr/local/oldgcc/usr/bin/ and call
% gcc /home/limes/applications/fft/test.c
well guess what? it works. it creates a.out
so then i though well let me try calling
% ../bin/gcc /home/limes/applications/fft/test.c
then it gives me the same error as before.
so whenever i access gcc through directories i get the error. i was wondering does anyone know why?

also, when i ran the successful gcc call and was given a.out, i tried running it by typing
% a.out
but it says command not found. this is the same error i get when trying to run other executable files such as audiogalaxy. am i doing something wrong???

any help would be greatly appreciated. thanks

frustrated
-srkherad
 
Old 10-11-2002, 03:50 AM   #2
dewcansam
Member
 
Registered: Nov 2001
Location: Hi Hat KY USA
Distribution: RedHat, Mandrake
Posts: 63

Rep: Reputation: 15
Well downloaded LIMES and the oldgcc tarball from the site. Created a sample c file and tried to complie it and got the same error (bash: /home/.../usr/bin/gcc: cannot execute binary file). That's what I wanted to see. So I droped down into the directory and tried it again. Got my out file, but started thinking what if that call to gcc wasn't to the version that you were expecting. And guess what ?
$ gcc --version
2.96

Tried to call it the proper way.
$ ./gcc --version
bash: ./gcc: cannot execute binary file

So my suggestion is to go to ftp://ftp.gnu.org/pub/old-gnu/gcc/ and get your version there.
 
Old 10-11-2002, 02:50 PM   #3
srkherad
LQ Newbie
 
Registered: Oct 2002
Posts: 17

Original Poster
Rep: Reputation: 0
is gcc2.6.3 compatible w/ PIII?

thanks so much for the ftp site. i tried looking for a gccc 2.6.3 download but wasn't successful.

so anyways, i downloaded gcc 2.6.3 from the public gnu ftp site you gave me and i was trying to configure it but it told me that it does not recognize my system PentIII(i686). is there any way to get around this? I kind of need the LIMES software which only works with this version of gcc, unless you know of another multiprocessor simulator that will run on a single PC for testing purposes. thanks
 
Old 10-11-2002, 03:13 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Re: problem calling gcc from another dir (please help)

Quote:
Originally posted by srkherad
Hi linux experts,
% gcc /home/limes/applications/fft/test.c
well guess what? it works. it creates a.out
so then i though well let me try calling
This one runs whatever gcc happens to be first in your path.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in calling multiple files in one file ajindal Programming 1 08-23-2005 12:08 PM
calling skb_pull problem linux_lover2005 Programming 0 04-11-2005 11:22 AM
odd recursion: calling "by hand" vs calling by cronscript... prx Programming 4 02-12-2005 04:59 PM
dir.h io.h location in gcc elena Linux - Software 2 01-18-2005 11:31 AM
Problem calling linux program from Java spasco Programming 3 04-25-2004 12:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:36 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