LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-22-2006, 12:30 PM   #1
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Rep: Reputation: 15
problem with makefile


hi i made 3 files which are
project.c
lib.c
lib.h


in project.c i write

#include <studio.h>
main()
{
printf("hello",dosomething(5));
}




in lib.c i write
#include "lib.h"


int dosomething( int x )
{
return (x*3);
}




in lib.h i write
int dosomething( int ) ;




and in the makefile i write
project.exeroject.o lib.o
cc -o project project.o lib.o
lib.o : lib.c
cc -c lib.o lib.c
project.o : project.c lib.h
cc -c project.o project.c lib.h

and thenn i go to the shell and i taped make
it said erreur:missing seperate
 
Old 12-22-2006, 12:35 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It is a complaint about the format of your makefile. Please repost your makefile in CODE tags to preserve the formatting.

--- rod.
 
Old 12-22-2006, 01:18 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by killer_instinct
cc -c lib.o lib.c
That "lib.o" shouldn't be there.
 
Old 12-22-2006, 01:31 PM   #4
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
where so can any body help me i guess it's a simple program !!!!
 
Old 12-22-2006, 01:36 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,783

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
As already asked for, please post your Makefile between code tags.

Something like:

Code:
project: project.o lib.o
  cc -o project project.o lib.o
lib.o : lib.c
  cc -c lib.c
project.o : project.c lib.h
  cc -c project.c lib.h
I fixed two lines there, as Nylex suggested, and the main target too.

Last edited by jlliagre; 12-22-2006 at 01:38 PM.
 
Old 12-22-2006, 02:12 PM   #6
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
thank you very much now i must tape make right
i mean i save what u tagged in a file called makefile then i tape make in the shell
 
Old 12-22-2006, 02:26 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,783

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Glad to know.
The reason it failed is likely missing spaces (or tab) before the cc commands in your original Makefile.
 
Old 12-22-2006, 03:22 PM   #8
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
my god it's the space so
really windows is more good than this unix
all of that because of space
merci pour ton aide mon ami(je parle aussi francais)
 
Old 12-22-2006, 03:51 PM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,783

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by killer_instinct
my god it's the space so
really windows is more good than this unix

Windows is certainly not "more good" than Unix because of this particular spacing issue.

At the opposite, breaking conventions like this one is commonly described as the obnoxious "Embrace and Extend" behaviour. http://en.wikipedia.org/wiki/Embrace...and_extinguish
 
Old 12-23-2006, 03:49 AM   #10
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
still not working i stay all day trying fix it but the same problem

Quote:
makefile:2:*** missing spepartors .stop

Last edited by killer_instinct; 12-23-2006 at 03:50 AM.
 
Old 12-23-2006, 04:26 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,783

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
What system are you running ?
 
Old 12-23-2006, 04:51 AM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Quote:
Originally Posted by jlliagre
At the opposite, breaking conventions like this one is commonly described as the obnoxious "Embrace and Extend" behaviour. http://en.wikipedia.org/wiki/Embrace...and_extinguish
Now you understand why IExplorer adds so many odd querks and didn't support CSS properly until Firefox posed a threat. If the IE browser was standards compliant, then web apps could become as useful as desktop apps, so applications could become desktop neutral threatening their main product.
 
Old 12-23-2006, 08:46 AM   #13
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
i use fedora fc4
what's the matter with that makefile
did you test that makefile
 
Old 12-23-2006, 10:48 AM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,783

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Again, can you post the makefile you are using, and between code tags.

And make sure the indented lines start with a tab, as POSIX standard requires.

Last edited by jlliagre; 12-23-2006 at 11:13 AM.
 
Old 12-23-2006, 11:11 AM   #15
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
Post

i use this one i write it and it's the same problem

Quote:
project: project.o lib.o
cc -o project project.o lib.o
lib.o : lib.c
cc -c lib.c
project.o : project.c lib.h
cc -c project.c lib.h

Last edited by killer_instinct; 12-23-2006 at 11:17 AM.
 
  


Reply

Tags
missing, stop


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
Makefile problem LuvMyKelly Linux - Newbie 2 12-09-2005 12:13 AM
Makefile Problem nelnel Programming 4 07-08-2005 02:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
Another problem with Makefile lucs Slackware 3 02-14-2005 05:06 PM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM

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

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