0

I am having "unresolved external symbol" linking error for a simple class i wrote along with a header file in VS 2008 using c++.

I moved this class to VS 2008's include directory, so that I don't have to copy the files from one project to other every time creating a new project.

I included the header file in some new project, the file got included alright, I can also see the list functions and data members inside the object of that class file, [ VS 2008 shows me this list after I type '.' ]

But this is not the weird part, the weird part is, the files which I moved to include directory works fine in the original project in which I wrote them.

2am
  • 699
  • 1
  • 7
  • 25
  • Was there a cpp file involved in the original project that implemented anything? – doctorlove Jul 16 '13 at 11:17
  • Yes, it was involved in the previous project, I later moved it to include dir, from there as well it was working fine. – 2am Jul 17 '13 at 05:58

2 Answers2

1

As well as including the header file in your new project, you will need to add the implementing cpp file, otherwise you will get

"unresolved external symbol"

link errors.

doctorlove
  • 18,872
  • 2
  • 46
  • 62
0

to understand "unresolved external symbol" issue please refer to: Unresolved external symbol in object files

Community
  • 1
  • 1
Rayee Roded
  • 2,440
  • 1
  • 20
  • 21