Do you have a main program? I create a main program (to test my individual .cpp files), just go to set up a new project. Create a new Win32 console application ("Hello World" works as a good template). From there, you put an include statement in your code like:
#include "c:\dir\dir\...\myfile.cpp"
and when you compile, it will compile the file you included. The included file you are trying to compile should have an include:
#include "c:\.....\myfile.h"
I don't know if that is what your problem is, but that's what I did to solve a problem of compiling and testing my .cpp files.
To add files that were created outside of the current project, to the current project...
Switch from the class view to the file view in the workspace.
Now, select the project that you would like to add the files too.
Right Click on the project, and select "Add Files To Project".
Select the files (via file open dialog that appears) and click OK.
The files are then in the project and will be compiled whenever the project is built.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.