How do I create both a .lib file and an .exe file in Visual C++?

前端 未结 5 1864
后悔当初
后悔当初 2021-02-07 10:51

I currently have a console project which creates an .exe file; I want it to also create a .lib file so other projects, compiled as DLLs, would be able to call functions from the

5条回答
  •  北海茫月
    2021-02-07 11:42

    It's not possible in general - static libraries and executables are completely different kinds of animal. The way to handle this situation is to create two projects - one for the library, which contains all the functionality. and one for the executable, which is a thin wrapper that simply calls functions in the library.

提交回复
热议问题