Skip to content

Commit c1c5911

Browse files
authored
Merge pull request #5482 from MicrosoftDocs/main
3/5/2024 AM Publish
2 parents 8db8f98 + 6ac25ab commit c1c5911

File tree

6 files changed

+67
-23
lines changed

6 files changed

+67
-23
lines changed
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
---
22
description: "Learn more about: Cross-platform mobile development examples"
33
title: "Cross-platform mobile development examples"
4-
ms.date: "10/17/2019"
5-
ms.assetid: bc384c12-fccc-45d7-9fb9-b90d536aa663
4+
ms.date: 03/04/2024
65
---
76
# Cross-platform mobile development examples
87

9-
Several of the templates installed by the **Mobile development with C++** workload generate complete examples that you can use to learn from. Additionally, the Windows Dev Center has several example applications that you can download and try out in Visual Studio.
8+
Several of the templates installed by the **Mobile development with C++** workload generate complete examples that you can use to learn from. Additionally, here are some example applications that you can download and try out in Visual Studio.
109

11-
- [hello-jni Android Application Sample](https://code.msdn.microsoft.com/hello-jni-Android-790ab73d)
10+
- [hello-jni Android Application Sample](https://github.com/android/ndk-samples/tree/master/hello-jni)
1211

1312
This sample is a port of the Android NDK hello-jni application. The sample demonstrates an end-to-end Java Native Interface "Hello World" app. It loads a string from a native method implemented in a shared library, and then displays it in the app.
1413

15-
- [TwoLibs Android Library Sample](https://code.msdn.microsoft.com/TwoLibs-Android-Library-6396e5c4)
14+
- [TwoLibs Android Library Sample](https://github.com/microsoftarchive/msdn-code-gallery-community-s-z/tree/master/TwoLibs%20Android%20Library%20Sample)
1615

17-
This sample is a port of the Android NDK TwoLibs sample. It uses both a dynamically loaded shared library, and a static C++ Android native library, that implements a method called from a Java Native Interface app. This sample is a good starting point for developers to understand how to use static/dynamic shared libraries to build an end-to-end JNI Android application with Visual Studio.
16+
This sample is a port of the Android NDK TwoLibs sample. It uses both a dynamically loaded shared library and a static C++ Android native library that implements a method called from a Java Native Interface app. This sample is a good starting point for developers to understand how to use static/dynamic shared libraries to build an end-to-end JNI Android application with Visual Studio.
1817

19-
- [test-libstdcpp Android Library Sample](https://code.msdn.microsoft.com/test-libstdcpp-Android-00b548f5)
18+
- [test-libstdcpp Android Library Sample](https://github.com/microsoftarchive/msdn-code-gallery-community-s-z/tree/master/test-libstdcpp%20Android%20Library%20Sample)
2019

2120
This sample is a port of the Android NDK test-libstdc++ sample, specifically for use with Visual Studio. This sample is a good starting point for developers to understand how to use the Standard Library.
2221

2322
To open one of the examples in Visual Studio, download the zip file and open the **Properties** page of the downloaded file in Explorer. Choose the **Unblock** button then choose **OK**. Extract the contents of the zip file to a convenient location, then open the C++ folder in the extracted sample and open the solution file.
2423

2524
To build the sample, press **F7**, or on the menu bar, choose **Build**, **Build Solution**.
25+
26+
## See also
27+
28+
[Android NDK samples](https://github.com/android/ndk-samples/tree/master/)
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
22
description: "Learn more about: Compiler Error C2101"
33
title: "Compiler Error C2101"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/04/2024"
55
f1_keywords: ["C2101"]
66
helpviewer_keywords: ["C2101"]
7-
ms.assetid: 42f0136f-8cc1-4f2b-be1c-721ec9278e66
87
---
98
# Compiler Error C2101
109

1110
'&' on constant
1211

13-
The address-of operator ( `&` ) must have an l-value as operand.
12+
The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand.
1413

1514
The following sample generates C2101:
1615

1716
```cpp
1817
// C2101.cpp
19-
int main() {
20-
char test;
21-
test = &'a'; // C2101
22-
test = 'a'; // OK
18+
int main()
19+
{
20+
int* ptr = &123; // C2101
2321
}
2422
```
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
---
22
description: "Learn more about: Compiler Error C2102"
33
title: "Compiler Error C2102"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/03/2024"
55
f1_keywords: ["C2102"]
66
helpviewer_keywords: ["C2102"]
7-
ms.assetid: d15b5fa3-fa46-4cd4-a3d2-3661646ecb7a
87
---
98
# Compiler Error C2102
109

1110
'&' requires l-value
1211

13-
The address-of operator ( `&` ) must have an l-value as operand.
12+
The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand. Address of temporary values cannot be taken.
13+
14+
The following sample generates C2102:
15+
16+
```cpp
17+
// C2102.cpp
18+
int func()
19+
{
20+
return 1;
21+
}
22+
23+
int main()
24+
{
25+
int* ptr = &func(); // C2102
26+
}
27+
```
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
---
22
description: "Learn more about: Compiler Error C2103"
33
title: "Compiler Error C2103"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/04/2024"
55
f1_keywords: ["C2103"]
66
helpviewer_keywords: ["C2103"]
7-
ms.assetid: dfe95972-35e9-469a-b8a8-52c849d4e4e4
87
---
98
# Compiler Error C2103
109

1110
'&' on register variable
1211

1312
You cannot take the address of a register.
13+
14+
The following sample generates C2103:
15+
16+
```c
17+
// C2103.c
18+
int main(void)
19+
{
20+
register int x = 1;
21+
int* ptr = &x; // C2103
22+
}
23+
```
24+
25+
> [!NOTE]
26+
> This error applies to C code.
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
---
22
description: "Learn more about: Compiler Error C2487"
33
title: "Compiler Error C2487"
4-
ms.date: "11/04/2016"
4+
ms.date: "03/04/2024"
55
f1_keywords: ["C2487"]
66
helpviewer_keywords: ["C2487"]
7-
ms.assetid: 95d734fb-64ac-488d-b799-64f084eecb09
87
---
98
# Compiler Error C2487
109

1110
'identifier' : member of dll interface class may not be declared with dll interface
1211

1312
You can declare a whole class, or certain members of a non-DLL interface class, with DLL interface. You cannot declare a class with DLL interface and then declare a member of that class with DLL interface.
13+
14+
The following sample generates C2487:
15+
16+
```cpp
17+
// C2487.cpp
18+
// compile with: /c
19+
class __declspec(dllexport) C
20+
{
21+
__declspec(dllexport) void func() {} // C2487
22+
};
23+
```
24+
25+
To resolve this error, remove the DLL interface on the class or the members.
26+
27+
## See also
28+
29+
[Using `dllimport` and `dllexport` in C++ classes](../../cpp/using-dllimport-and-dllexport-in-cpp-classes.md)

docs/windows/latest-supported-vc-redist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: msaleh
1717

1818
# Microsoft Visual C++ Redistributable latest supported downloads
1919

20-
The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools. If your app uses those libraries, a Microsoft Visual C++ Redistributable package must be installed on the target system before you install your app. The Redistributable package architecture must match your app's target architecture. The Redistributable version must be at least as recent as the MSVC build toolset used to build your app. We recommend you use the latest Redistributable available for your version of Visual Studio, with some exceptions noted later in this article.
20+
The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. Many applications built using Microsoft C and C++ tools require these libraries. If your app uses those libraries, a Microsoft Visual C++ Redistributable package must be installed on the target system before you install your app. The Redistributable package architecture must match your app's target architecture. The Redistributable version must be at least as recent as the MSVC build toolset used to build your app. We recommend you use the latest Redistributable available for your version of Visual Studio, with some exceptions noted later in this article.
2121

2222
For details on how to install and redistribute Visual Studio components, see [Redistributing Visual C++ Files](redistributing-visual-cpp-files.md).
2323

@@ -48,7 +48,7 @@ Download other versions, including long term servicing release channel (LTSC) ve
4848

4949
- Visual Studio versions since Visual Studio 2015 share the same Redistributable files. For example, any apps built by the Visual Studio 2015, 2017, 2019, or 2022 toolsets can use the latest Microsoft Visual C++ Redistributable. However, the version of the Microsoft Visual C++ Redistributable installed on the machine must be the same or higher than the version of the Visual C++ toolset used to create your application. For more information about which version of the Redistributable to install, see [Determining which DLLs to redistribute](determining-which-dlls-to-redistribute.md). For more information about binary compatibility, see [C++ binary compatibility between Visual Studio versions](../porting/binary-compat-2015-2017.md).
5050

51-
- **Windows XP Support**: Microsoft ended support for Windows XP on April 8, 2014. Current versions of the Visual C++ Redistributable for Visual Studio 2015-2022 only support Windows Vista, 7, 8.1, 10, and 11. The last version of the Visual C++ Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with **14.27**). The Redistributable is available in the [my.visualstudio.com Downloads](https://my.visualstudio.com/Downloads/) section as **Visual C++ Redistributable for Visual Studio 2019 (version 16.7)**. Use the Search box to find this version. To download the files, select the platform and language you need, and then choose the **Download** button.
51+
- **Windows XP Support**: Microsoft ended support for Windows XP on April 8, 2014. Current versions of the Visual C++ Redistributable for Visual Studio 2015-2022 only support Windows 7, 8.1, 10, and 11. The last version of the Visual C++ Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with **14.27**). The Redistributable is available in the [my.visualstudio.com Downloads](https://my.visualstudio.com/Downloads/) section as **Visual C++ Redistributable for Visual Studio 2019 (version 16.7)**. Use the Search box to find this version. To download the files, select the platform and language you need, and then choose the **Download** button.
5252

5353
- The Visual C++ Redistributable supports several command-line options. For more information, see [Command-line options for the Redistributable packages](./redistributing-visual-cpp-files.md#command-line-options-for-the-redistributable-packages).
5454

0 commit comments

Comments
 (0)