I have not worked with Visual Studio before. I started my own project in my free time, and I would like to use test development, as this was a huge advantage for me in my Java development. I started this project just recently and I used CppUnit. I know that there are probably other frameworks that are better, but that already exists.
There are two projects in my Visual Stuido 2005. It worked great when unit tests were located right next to the application code. As the size of the project increased, it became rather cumbersome and inelegant. I created a new project under my solution for placing unit tests (so now it has 3 projects). Everything went fine until I tried to build a solution. Everything compiled, but the unit test project could not be linked. The result gives me 51 "unresolved external characters" (LNK2019) for every function that my tests call.
As far as I can tell, the problem is the directory structure created by Visual Studio. Each project gets its own directory, and then below are the object files and executable files that are created. I think the problem is that although the header files are correctly included in each unit test, the linker cannot find the cpp files because they are in a different directory. When it fails to find the implementation of the called function, it gives me error 2019.
Am I right in my assessment of the problem? How can i fix this? Do I need to completely reorganize my projects or is this a simple linker configuration?
thank
dun3141
source
share