I have a c++ header file containing a class. I want to use this class in several projects, bu I don\'t want to create a separate library for it, so I\'m putting both methods
Don't put a function/method definition in an header file unless they are inlined (by defining them directly in a class declaration or explicity specified by the inline keyword)
header files are (mostly) for declaration (whatever you need to declare). Definitions allowed are the ones for constants and inlined functions/methods (and templates too).