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)

(I'm trying to pass a value to a function who's signature is : void b::foo(int i);
and the function call: int j=8;

PS- the code works in visual studio

Have you included the header file where foo() function is initialized? What about creating an object to class b then call the foo() function:

[I]b[/I] bVar;
int j = 8;

I think you should post this to c++ forum and give more details on the problem.

10X for your reply. Next time i'll post these kind of questions in the c++ forum.
The problem was that i needed to use const.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.