Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 7
    First of all - don't put ".h" files as a parameter to the compiler. They're already included in your ".cpp" files. What's the missing references? What is the linker error you're getting? Commented Mar 13, 2011 at 22:58
  • 7
    Also, never put using namespace std; in a .h file. Commented Mar 13, 2011 at 23:01
  • 2
    Next time paste the error msgs too. Commented Mar 13, 2011 at 23:12
  • I had a similar issue with getting the undefined reference to error, turns out I forgot to include the .cpp with code in the .h. Commented Aug 30, 2017 at 22:30
  • 1
    @Avamander That's the wrong way. You include your header files (i.e., .h) in your source files (i.e., .cpp), not the other way around. Commented Jun 10, 2020 at 12:15