开发者

Visual Studio 2008 C++ Compilation: No Lib file Generated

I want to build a C++ project as a dll, the procedure I follow is explained here. Note that during the project creation stage, I specify the DLL instead of static library. My understanding is that by doing so both a .dll and a .lib will be created.

But after I compile that project, only .dll is created, the .lib file, on the other hand, is not.

The problem of this is that, when I reference that C++ project in another C++ project ( again, using the sam开发者_运维百科e procedure here), I got a fatal error lnk1104:

fatal error LNK1104:cannot open file '..\debug\cgapi.lib'

Anything I miss in my vcproject setup?


The generic diagnostic is that you didn't export anything. You can double-check with Dumpbin.exe /exports on your DLL.

Be sure to decorate the functions you want to export with __declspec(dllexport). Or use a .def file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜