NDK的构建:CreateProcess的:使(E = 87):参数不正确 [英] Ndk-build: CreateProcess: make (e=87): The parameter is incorrect

查看:3748
本文介绍了NDK的构建:CreateProcess的:使(E = 87):参数不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到在Windows平台NDK编译静态库的错误:

I get an error when build static lib with NDK on Windows platform:

process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed.
make (e=87): The parameter is incorrect.
make: *** [obj/local/armeabi-v7a/staticlib.a] Error 87
make: *** Waiting for unfinished jobs....

所有的源文件的成功打造,而这个错误发生时,撰写的目标文件。

All source files build successfully, and this error occur when compose object files.

在构建这个项目在Ubuntu中,它仅出现在Windows上我没有得到这个错误。

I don't get this error when build this project in Ubuntu, it occur only on Windows.

我想我找到了问题:的<第二个参数href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx\">CreateProcess赢API函数的 lpCommandLine 有最大长度 32,768 的字符。但在我的情况下,超过32,768个字符。

I suppose I found the issue: second parameter of CreateProcess Win API function lpCommandLine has max length 32,768 characters. But in my case it is more than 32,768 characters.

我怎样才能解决这个问题呢?

How I can solve this issue?

推荐答案

也许 LOCAL_SHORT_COMMANDS 标志,在你的Andr​​oid.mk进行设置,可以帮助你。它的目的是克服在字符的Windows命令可以处理的数量的限制。

Maybe the LOCAL_SHORT_COMMANDS flag, to be set in your Android.mk, could help you. It is designed to overcome the limitations on the number of characters a Windows command can handle.

根据$(NDK文件夹)/docs/ANDROID-MK.html:

According to $(NDK folder)/docs/ANDROID-MK.html:

LOCAL_SHORT_COMMANDS

LOCAL_SHORT_COMMANDS

这个变量设置为真时,你的模块具有非常高数
     源和/或依赖静态或共享库。这迫使
     建立系统使用一个中间列表文件,并与使用
     库存档或静态链接与@ $(的文件列表)语法。

Set this variable to 'true' when your module has a very high number of sources and/or dependent static or shared libraries. This forces the build system to use an intermediate list file, and use it with the library archiver or static linker with the @$(listfile) syntax.

这可以在Windows,在命令行只接受有用
     最多8191个字符,它可以是对于复杂的过小
     项目。

This can be useful on Windows, where the command-line only accepts a maximum of 8191 characters, which can be too small for complex projects.

这也影响单个源文件的编译,将
     里面几乎所有的名单编译器选项文件了。

This also impacts the compilation of individual source files, placing nearly all compiler flags inside list files too.

请注意,任何其他值比'真'会恢复到默认
     行为。您还可以定义APP_SHORT_COMMANDS你
     Application.mk迫使这种行为在所有的模块
     项目。

Note that any other value than 'true' will revert to the default behaviour. You can also define APP_SHORT_COMMANDS in your Application.mk to force this behaviour for all modules in your project.

请注意:我们不建议在默认情况下启用此功能,因为它
           使得构建慢。

NOTE: We do not recommend enabling this feature by default, since it makes the build slower.

希望这有助于!

这篇关于NDK的构建:CreateProcess的:使(E = 87):参数不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆