LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2015, 03:13 AM   #1
om178890
LQ Newbie
 
Registered: Aug 2015
Posts: 19

Rep: Reputation: Disabled
While compiling in gcc i got error /bin/sh: line 2: -g: command not found


Hi ,

While compling my code i got the below mentioned error :

/bin/sh: line 2: -g: command not found
make[2]: *** [all] Error 127
make[1]: *** [all] Error 2
/bin/sh: line 2: -g: command not found
make[2]: *** [all] Error 127
make[1]: *** [all] Error 2

However in make file i have set CC and LD option as below:

CC = /usr/bib/gcc
LD = /usr/bin/ld

Can anyone help me to short my problem.

Last edited by om178890; 08-05-2015 at 08:15 AM. Reason: Got the reason of the error. Some path where not resolved.So the error was coming. After resolving the path. It complied succ
 
Old 08-05-2015, 03:56 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
would be nice to see what command have you tried, what is in your makefile. Otherwise the error is in line 25.
 
1 members found this post helpful.
Old 08-05-2015, 06:13 PM   #3
ratt_salad
LQ Newbie
 
Registered: Jul 2015
Location: Canada
Distribution: PCLinuxOS
Posts: 14

Rep: Reputation: Disabled
If you are using gcc, you only need to specify a linker if you are not using ld.

CC = gcc -Wall
 
Old 08-05-2015, 07:36 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
without knowing any of the NEEDED information
there is NOTHING we can do

what operating system is this?
what are you building ?
and HOW!!!!! are you building it ?

what is the command you are using ?
and
What is the full error ?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling u-boot for AM335x => /bin/bash: arm-none-linux-gnueabi-gcc: command not fou brentw Linux - Embedded & Single-board computer 3 08-24-2014 11:03 AM
GCC Command not found while compiling C program in rhel6.0 debashisenator Red Hat 5 08-06-2012 04:19 PM
[SOLVED] version-check.sh: line 32: gcc: command not found dwmolyneux Linux From Scratch 8 06-02-2012 10:17 AM
/bin/sh: gcc: command not found muruganm Linux - Embedded & Single-board computer 2 07-03-2008 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:00 AM.

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