0

Is it possible to update a project to change from exe to lib depending on if it is set as the startup project?

ie:

  • Project: Foo
  • Project: Foo-Unit-tests

using the Pimpl idiom I'm getting link errors if foo is an .exe. Changing it to .lib resolves everything.

So what I'm aiming for is if it is possible to have it that the:

Project>Properties>Configuration Properties>General>[Configuration Type]: = Static library (.lib)

  • When project Foo-Unit-tests is the startup project. (FOO = .lib)
  • IF the project: Foo is the startup project, have it set to Application (.exe) instead.

Is there some command line prompts that could allow for this or some settings that can be configured to do this?

jc.021286
  • 220
  • 1
  • 4
  • 15
  • 1
    LIBs aren't linked and can't be run so you won't get link errors from a lib project. And no the project type is fixed when you create them. One option is to always make static library projects for all your work and then a stub exe (or dll) which uses the static libraries. – Richard Critten Dec 22 '22 at 20:01
  • Thanks, I think I understand. For creating a stub exe, any recommendation to follow? Initial searches show stub functions, builder and stub C. Is there another terminology or are we effectively saying that I should just have another project that is the executable and all it does is link to the original that is now a DLL? – jc.021286 Dec 22 '22 at 21:00

0 Answers0