Android NDK include of math.h gives "use of undeclared identifier" error - android-ndk

I've a solution containing two project types .androidproj (Android) and .vcxproj (C++) in my Visual Studio 2017 Community Edition. I use android-ndk-r13b for the C++ part.
Since the update from Visual Studio 2017 Community Edition version 15.5.7 to 15.6.1 (release notes) I experience the following blocking error:
error : use of undeclared identifier 'acosl'
See the representing lines in the build output:
In file included from C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\android\support\include\math.h:31:
C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\llvm-libc++\include\math.h(661,91): error : use of undeclared identifier 'acosl'
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
Next to the acosl also all other math functions are not found.
Unfortunately those Posts didn't help in my case:
Visual Studio 2015, Android NDK with libc++ and cmath issues
Visual Studio 2017 Android NDK math.h
Any hints what I could try?
Update
The minSdkVersion is set to 15. The solution compiled before the Visual Studio update without errors.

With 15.6 they seem to have introduced a change in the MSBuild file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Android\3.0\Default.props" which contains a bunch of default input values (MSBuild properties) for the Android build process of Visual Studio.
The change that causes this issue is the new default value of the UseOfStl which is now c++_static while in previous releases it was gnustl_static.
As mentioned this is only a default value so you can fix this by explicitly setting the proper value, c++_static in this case, in your affected vcxproj files.
The easiest way to do so is to open the properties page of your vcxproj and in the "General" page set the "Use of STL" to "GNU STL static library (gnustl_static)" as shown in the screenshot.
Note that this issue has been posted as a bug here: https://developercommunity.visualstudio.com/content/problem/211533/visual-studio-update-156-breaks-c-android-app-buil.html

Related

Unreal Engine 4 Beginner: Error While Adding an Empty C++ Component

The scene is empty with just a Chair[A Static Mesh Component].
Tried cleaning the project.
I am completely new.
What you can do is to open File Explorer and navigate to your project, and right click on .uproject file and select option Generate Visual Studio Files. After that you can compile
This is a known issue in 4.20 and 4.20.1 which has been reported and has been declared fixed but they haven't patched it in the engine yet.
It is only an intellisense error however. If you have problems compiling then just use the in - editor button for compilation and don't compile from Visual Studio.
Here is the original bug report:
https://issues.unrealengine.com/issue/UE-62042
The fix will be included in 4.20.2 when it releases.

C++ Cannot open include file: "vector": No such file or directory

I am having this weird vector error in C++ Visual Studio 2015. I have tried many times to add it to the directories in properties in Additional Include. That does not seem to fix the error.

Platform Toolset change on VS 2015

I need to do some Assembly coding on VS 2015 and for it I need to use an include file that uses certain C functions. The file worked perfectly on VS 2012 and 2013, but due to some library changes on VS 2015 (as far as I understand), it gives an error on the linking process. So, I was advised to set my Platform Toolset back to VS 2012 or lower, but the only ones that appear on the changing menu are the 2015 ones. I tried to download and install the said toolkits, but even then they don't appear in the drop-out menu. Is there something I'm doing wrong, or is there another way to do this? (eg. an include file with basic print and _getch functions that works on VS 2015) Here is a screenshot of the Toolset selection screen, if it helps:

Use Visual Studio 2012 and cant find project property pages

I Use Visual Studio Ultimate 2012 and try open "project property pages".
I need open the Properties of the project, go to Configuration Properties → General → Platform Toolset. Here switch to any older version of the toolset: Visual Studio 2012 (v110xp), or any other choice.
This window should look like this:
| "Configuration Properties"
-|General
-|Debugging
-|VC++ Directories
-|C/C++
--|General
--|Optimization
--|Preprocessor
--|Code Generator
--|Language
--|Precomplied Header
--|Output files
--|Browse information
--|Advanced
--|All option
--|Command Line
-|Linker
...
But my version looks like this:
"project property pages
-|Application
-|Build
-|Build events
-|Debug
-|Resourses
-|Services
-|Settings
-|Reference Path
-|Signing
-|Security
-|Publish
-|Code Analysis
How do I get to the window?
I think it's a bug on VS2012, it always do this to me.
You must use older toolset (or install vs2013).
As you can't change it in VS2012 (property doesn't available), you must change manually project file. Open vcxproj file in a text editor, and change all occurences of
<PlatformToolset>v110</PlatformToolset>
by
<PlatformToolset>v100</PlatformToolset>
Then save and reopen the project in VS2012

Show file type icons on tabs on visual studio 2012

I wass looking for quite some time now how I could see the file type icon of each file I have opened in visual studio 2012 tab well, like it was shown on previous versions of visual studio. This was completely removed from vs 12, couldn't find any option enabling this. This is something extemely usefull when having many open files.
I found that this option exists on the registry!
So you go here:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\DialogPage\Microsoft.CustomDocWell.Options
and change the IconInTabs property from false to True!
File type icons are displayed again next to each tab!!!!
Edit: In order for this to work you must have installed Productivity Power Tools 2012 plugin

Resources