gavinpugh / vs-android

Integrated development of Android NDK C/C++ software with Microsoft Visual Studio.
Other
119 stars 34 forks source link

Compilation failure due to wrong PCH treatment #131

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Visual studio 2012 version 11.0.61030.00 update 4.
2. Compiling for arm-linux-androideabi 4.8
3. Not using Precompiled header PCH files
4. Precompiled header output file:       <-- is left empty

What is the expected output? What do you see instead?
Getting the following error:
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Android\Microsoft.Cpp.Android.Ta
rgets(99,5): error MSB6001: Invalid command line switch for 
"arm-linux-androideabi-g++.exe". The path is not of a legal form.

I found how to fix it: putting the setting
Precompiled header output file: $(IntDir)$(TargetName).pch.h
even though I am not using precompiled headers at all.
Now everything compiles.
My guess - you have a mistake in Microsoft.Cpp.Android.targets file.

Original issue reported on code.google.com by Daniel...@gmail.com on 18 Dec 2014 at 2:17

GoogleCodeExporter commented 9 years ago
I think this is due to an imported "PrecompiledHeader" variable from another 
config/plat setup. This can happen when adding "Android" to an existing VS 
Project and choosing to "Copy Settings From" another platform, rather than 
setting that entry to "<empty>" to start fresh.

It's probably possible to check for an empty string though in this case, and 
use the default value. Which is how I assume Win32/x64 must behave.

Original comment by gavin.dj.pugh on 29 Dec 2014 at 6:06