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 08-25-2008, 05:13 AM   #1
kerenLinuxForum
LQ Newbie
 
Registered: Aug 2008
Posts: 15

Rep: Reputation: 0
Create make file using -MD


Hi,
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, 03:46 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,657

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

Rep: Reputation: 63
gcc is for compiling C sources. If you want to compile C++ sources, use g++.
 
Old 08-27-2008, 05:56 AM   #4
kerenLinuxForum
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).
 
  


Reply


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 09:48 PM
how to create a new file including content from reading another file !? silverhand Programming 2 10-06-2007 04:33 PM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 11:21 AM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 07:55 PM
Is there a way to make a program create a pid file? blk96gt Slackware 1 10-29-2004 11:59 AM

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

All times are GMT -5. The time now is 05:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration