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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
12-22-2006, 12:30 PM
#1
LQ Newbie
Registered: Dec 2006
Posts: 26
Rep:
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.exe
roject.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
12-22-2006, 12:35 PM
#2
Senior Member
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 4,508
It is a complaint about the format of your makefile. Please repost your makefile in CODE tags to preserve the formatting.
--- rod.
12-22-2006, 01:18 PM
#3
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371
Rep:
Quote:
Originally Posted by killer_instinct
cc -c lib.o lib.c
That "lib.o" shouldn't be there.
12-22-2006, 01:31 PM
#4
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
where so can any body help me i guess it's a simple program !!!!
12-22-2006, 01:36 PM
#5
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
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 .
12-22-2006, 02:12 PM
#6
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
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
12-22-2006, 02:26 PM
#7
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
Glad to know.
The reason it failed is likely missing spaces (or tab) before the cc commands in your original Makefile.
12-22-2006, 03:22 PM
#8
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
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)
12-22-2006, 03:51 PM
#9
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
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
12-23-2006, 03:49 AM
#10
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
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 .
12-23-2006, 04:26 AM
#11
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
What system are you running ?
12-23-2006, 04:51 AM
#12
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263
Quote:
Originally Posted by jlliagre
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.
12-23-2006, 08:46 AM
#13
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
i use fedora fc4
what's the matter with that makefile
did you test that makefile
12-23-2006, 10:48 AM
#14
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
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 .
12-23-2006, 11:11 AM
#15
LQ Newbie
Registered: Dec 2006
Posts: 26
Original Poster
Rep:
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 .
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 02:50 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News