更新时间:2021-08-08 23:05:41
这是不可能的 - 静态库和可执行文件完全不同种类的动物。处理这种情况的方法是创建两个项目 - 一个用于库,其中包含所有功能。和一个用于可执行文件,它是一个简单的调用函数库中的函数的薄包装。
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.