在VS中用VisualGDB插件编译安卓工程,莫名其妙突然出现以下报错:clang++.exe: error: unable to execute command: Couldn't execute program 'P:\android\android-ndk-r10e\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin\ld.exe'The filename or extension is too long.
一番Google之后找到了以下解决方法:
The problem is caused by a known miscalculation in clang's commandLineFitsWithinSystemLimits function which underestimates the command line length. To "fix" the issue, just add some dummy cpp files until so that even the incorrectly underestimated command line would exceed the platform limits. 2 - 5 dummy files should do it, or alternatively just one dummy with a long filename. This causes clang to invoke the linker with a command file like it should.
按照上面说的,在工程中增加了一个虚拟的Cpp文件,并且取了个超长的名字,比如 ThisIsADummyFileJustForAClangLinerError_DeleteThisAfterSolvingProblem.cpp
问题就解决了...
本文介绍了一种在Visual Studio使用VisualGDB插件编译安卓工程时遇到的“命令行过长”错误的解决方案。通过添加虚拟的Cpp文件并给予超长的文件名,使编译器正确调用链接器,从而解决问题。
1362

被折叠的 条评论
为什么被折叠?



