0

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?

Community
  • 1
  • 1
Bluebaron
  • 2,289
  • 2
  • 27
  • 37

1 Answers1

1

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.

Captain Obvlious
  • 19,754
  • 5
  • 44
  • 74