我试图使用LIbrarian> Command Line中的以下选项
/OUT:"mylib.lib" "mylib.dll" /DEF:"mydef.def"但是,它只生成静态库。 当我的DLL文件名在/OUT指令之前时,它只生成DLL,但不生成LIB。
我只是想为我的库创建DLL和LIB文件,而不必使用__declspec(dllimport)或__declspec(dllexport)
有人能帮助我吗?
I have tried to use the following option from LIbrarian > Command Line
/OUT:"mylib.lib" "mylib.dll" /DEF:"mydef.def"However, it only generated the static library. When my DLL filename precedes the /OUT directive, it only produces DLL, but not LIB.
I simply want to create DLL and LIB files for my library without having to use __declspec(dllimport) or __declspec(dllexport)
Could someone help me
最满意答案
尝试这个:
/OUT:"mylib.dll" /IMPLIB:"mylib.lib" /DEF:"mydef.def" /DLL从命令行,您需要/DLL但/IMPLIB不是必需的,因为默认名称将取决于您的DLL名称。
从IDE编译时,编译具有/LD参数,该参数确保将/DLL传递给链接器。 因此,如果您自己构建命令行,则需要明确说明。
Try this:
/OUT:"mylib.dll" /IMPLIB:"mylib.lib" /DEF:"mydef.def" /DLLFrom the command line, you need /DLL but the /IMPLIB is not strictly necessary because the default name will depend on your DLL name.
When compiled from the IDE, the compile has a /LD parameter, which ensures that /DLL is passed on to the linker. So if you're building the command line yourself you need to make it explicit.
更多推荐
发布评论