Header file automatically linking cpp file?

I made my header file. If cpp file with definitions is in project compiler knows it has to be linked, but if it's not compiler doesn't know. If I include standard library or boost I don't have to manually link cpps. How to do so including my header automatically links cpp? Maybe problem is with something else? If you know solution, help would be appreciated. I use VS 2013.
Last edited on
You probably need inline functions/methods, but I'm not sure what you mean.
I mean I've got header file "mystuff.h" and cpp file "mystuff.cpp" in one folder. I added include path to my compiler and included "mystuff.h" in project with just "main.cpp" in it. Since compiler didn't have "mystuff.cpp" in this project's folder it wasn't linked and compiled along with "main.cpp". How to do it, so "mystuff.cpp" is going to be added to compilation process?
Last edited on
#pragma comment(lib, "foo.lib") http://support.microsoft.com/kb/153901
https://binglongx.wordpress.com/tag/pragma-comment-lib/

I suppose that you'll need to create a library from your cpp and put it in an standard place
But that works only for VS. Anyway thanks, it's good for now.
Topic archived. No new replies allowed.