在Windows命令提示符

时间:2015-06-12 14:30:28

标签: windows maven dll cmd linker

作为我在Windows上构建maven的最后一步,它尝试通过链接大约1500个目标文件来创建dll文件。看起来像这样:

cl.exe foo.dll (around 1500 .obj files) (couple of other statically linked libraries)

构建失败,只有一个语句: The command line is too long.

尝试搜索解决方案hereherehere,但解决方案更具针对性,而不是更通用的解决方案。任何人都能建议我能做些什么吗?

1 个答案:

答案 0 :(得分:1)

我想我得到了我的问题的答案。 我可以将命令的参数捆绑在.rsp文件中,然后在我的命令提示符下使用可执行文件在“@”之前添加其路径后将其激活。 所以,对于这个命令:

cl.exe foo.dll (around 1500 .obj files) (couple of other statically linked libraries)

我把这个

foo.dll (around 1500 .obj files) (couple of other statically linked libraries)
文件中的

makeDLL.txt。通过更改其扩展名(.rsp)将其更改为makeDLL.rsp文件并启动此命令:

cl.exe @<full-path of makeDLL.rsp>

这对我有用。