Build Succeeded, but no .lib file gets created

前端 未结 10 1317
执笔经年
执笔经年 2021-01-31 13:37

I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says \"... Generating C

10条回答
  •  长情又很酷
    2021-01-31 14:26

    I had the same problem, even though I was already using the __declspec(dllexport) function.

    Your ProjectName.cpp file needs to #include "ProjectName.h". If you don't include the header file then the functions don't get exported. The DLL builds fine, no errors or warnings (at least in VS2017 15.8), but you don't get a LIB file.

    Include the header and boom - LIB file is generated. A rookie mistake I'm sure, but everyone has to start learning somewhere.

提交回复
热议问题