在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
问题就解决了...