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.
精彩评论