Reputation: 2526
I created a Google Test project to test an executable project.
I added a reference to the executable project.
I'm getting a linker error: error LNK2019: unresolved external symbol "public: static bool __cdecl Utilities::CopyFileToRemoteLocation(...
I'm seeing from one source that the reason this is happening is because it's an exe project and it needs to be a dll. Google Test: error LNK2019: unresolved external symbol with Visual Studio 2013
The thing is, I need it to be an executable.
Will I have to separate the logic into a dll? Will I be able to statically link that dll if I do? We need to have a single-file executable for delivery.
Opinions on best course of action?
Upvotes: 0
Views: 712
Reputation: 20073
Based on your requirements the only option is to separate all of the code you intend to test into a static library. This will allow you to maintain a single executable file with no additional runtime dependencies and create a separate application for testing.
Upvotes: 1