.h and .cpp files in VS 2008

Hi all, sorry for bothering with very trivial questions, but I spent some times trying to fix this without success..
I have some problems in building projects with VS2008.
Let us assume I have the following files:

file "MinMax.h"

1
2
3
4
5
6
#ifndef MINMAX_H
#define MINMAX_H

double Max(double a, double b); 
double Min(double a, double b); 
#endif 




file "MinMax.cpp"


1
2
3
4
#include "MinMax.h"

double Max(double a, double b){return (a>b?a:b);} 
double Min(double a, double b){return (a<b?a:b);} 


file "Main.cpp"

1
2
3
#include "MinMax.cpp"

int main() {double x=Max(2,3); return 0;}


I create an empty project and then I add the previous files. When I hit "build", I get

fatal error C1083: Impossible to open file "MinMax.cpp": no such file or dir.


What am I missing?

Many thanks
How about getting VS 2010? No need to work with outdated products. Aside from that, did you move the files after creating the project or something like that?

PS: Don't put the main function into a single line... in fact, don't do that with anything.
Many thanks for your reply,

do you mean I have to copy the files in the folder in which my project is contained? I thought that adding existing files to a project was meaning to create copies of those files in the right folder, isn't it?
(Btw, I have to work with VS2008 just because that's the def prog we have in my my office , and I have no admin rights on my machine... )
You were 100% right, just copied files and now it works...many thanks!
Topic archived. No new replies allowed.