LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-30-2005, 10:12 AM   #1
Mogul83
LQ Newbie
 
Registered: May 2005
Posts: 5

Rep: Reputation: 0
makefile gcc command cannot be found


Hey Everyone,

The last couple of days i'm have been trying to do some linux kernel module programming. I was trying to compile the first example "hello1". The makefile consist of the following :

TARGET := hello-1
WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
INCLUDE := -isystem /lib/modules/`uname -r`/build/include
CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC := gcc-3.0

${TARGET}.o: ${TARGET}.c

.PHONY: clean

clean:
rm -rf {TARGET}.o

A week ago when i type the command "make" everything went well. I had problems inserting this module with insmod. I decided to change the makefile and compile it again. But now i'm getting error message "gcc command cannot be found ". I updated redhat before I got this error message. I check to to see if the gcc version is the same as in the makefile, which was not the case. I change the line "CC:= gcc-3.0 to gcc-3.2.2" but i'm still getting the same error message. Can someone tell me what i am doing wrong? I have redhat 9.0
 
Old 05-30-2005, 10:27 AM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
Is there any reason why you're using a specific version of gcc?
Try leaving it on
CC:= gcc
 
Old 05-30-2005, 11:02 AM   #3
Mogul83
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I tried leaving the 3.0 out but now i getting the following error message " cannot specify -o with -c or -S and multiple compilations"

I'm follwing the examples that are written in the document. http://www.faqs.org/docs/kernel/x204.html
 
Old 05-30-2005, 11:19 AM   #4
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
Are you using the same makefile?

There is no -o
in the makefile you posted.
 
Old 05-30-2005, 11:28 AM   #5
Mogul83
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I'm using the same makefile only the name of the target is different

According to me, the line "${TARGET}.o: ${TARGET}.c" specifies the name of the input and the output file.

At the top of the makefile has "TARGET := hello-1".

I could be wrong what i just said but reading it i would think that line specifies the -o
 
Old 05-30-2005, 03:01 PM   #6
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
I copy and pasted your makefile, seems to work ok for me.
 
Old 05-30-2005, 03:34 PM   #7
Mogul83
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Strange... That it doesn't work with me.. If anyone have suggestions let me know.. i'll continue to solve this mysterious error...
 
Old 05-31-2005, 03:11 AM   #8
Mogul83
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
It works fine now.. I remember a few weeks ago i compiled it i use gcc command, seeing that it was C-file. Now compiling the hello.c with the makefile. it cause conflict with the old output file, which was still in the directory.

Beginners mistake..
 
  


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
make fail with: gcc-3.4 command not found andy101 Ubuntu 3 11-27-2005 01:45 AM
bash: gcc: command not found sandbag Linux - Software 8 05-05-2005 12:17 PM
VSFTPD make: gcc: Command not found Exutable Linux - Software 4 04-06-2005 02:15 PM
Error Message gcc: Command not found Schmurff Fedora 2 09-27-2004 12:23 PM
I found this in the makefile. What does it mean ? lostboy Linux - General 3 03-25-2003 10:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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