Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-25-2008, 06:13 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 15

Rep: Reputation: 0
Create make file using -MD

I have a complex project (100 source files) and I have a make file from the format
SRCS= a.cpp b.cpp .....
%.o : %.c
gcc -c -MD -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
However, I receceive a compilation error :
In a.cpp: error no matching function for call to b::foo(int&)
candidates are: b::foo(int)

Is this is a linking problem ?
Old 08-26-2008, 04:46 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,681

Rep: Reputation: 218Reputation: 218Reputation: 218
No, I guess there may be missing include, so the prototype is not seen at the correct place.
Old 08-26-2008, 05:18 PM   #3
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 64
gcc is for compiling C sources. If you want to compile C++ sources, use g++.
Old 08-27-2008, 06:56 AM   #4
LQ Newbie
Registered: Aug 2008
Posts: 15

Original Poster
Rep: Reputation: 0
10x for your replies.
The problem was that I try to pass a temporary variable to a function whose signature is :
foo (int a, int&b).


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
Create File Shell Syntax and pass data to the file FirstBorn Linux - General 22 07-31-2008 10:48 PM
how to create a new file including content from reading another file !? silverhand Programming 2 10-06-2007 05:33 PM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 12:21 PM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 08:55 PM
Is there a way to make a program create a pid file? blk96gt Slackware 1 10-29-2004 12:59 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration