I normally work with C#. In C# I can have a hierarchy, and they reference each other.
I am trying to do the same in VC++, but I dont know how. I don't have much experience with C++ in general.
I have:
- TestProject1
- TestProject2: I need to use classes that are in TestProject1 here.
I tried adding TestProject1 as reference of TestProject2:
Right Clikc on the TestProject1-> Properties -> Common Properties -> Framework and References -> Add New Reference -> Selected TestProject2
But this results in an error, because TestProject2 is not built as a lib.
From what I can see only a list of obj files are generated.
What is the correct way to reference TestProject2 in TestProject1 so I can use its classes?
Update: How I solved it
I solved the issues by following SOReader instructions, but I added the lib in a different way:
- First I changed the TestProject1 project type as SOReader indicated (Right Click on TestProject1 project -> Properties-> Configuration Properties -> General-> Set Configuration Type to Static library (lib)
- Add reference to TestProject1 in TestProject2 -> Right Click on TestProject2 project -> Properties-> Common Properties -> Framework and References -> Add New Reference -> Select TestProject1