You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/cmake-remote-debugging.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ In this tutorial, you'll learn how to:
26
26
27
27
To set up Visual Studio for cross-platform C++ development, install the build tools for the target architecture. For this tutorial, install the ARM64 build tools by doing the following:
28
28
29
-
1. Run the Visual Studio Installer. If you haven't installed Visual Studio yet, see [Install Visual Studio](https://docs.microsoft.com/visualstudio/install/install-visual-studio#:~:text=Install%20Visual%20Studio%201%20Make%20sure%20your%20computer,...%204%20Choose%20workloads.%20...%20More%20items...%20)
29
+
1. Run the Visual Studio Installer. If you haven't installed Visual Studio yet, see [Install Visual Studio](/visualstudio/install/install-visual-studio)
30
30
1. On the Visual Studio Installer home screen, choose **Modify**.
31
31
1. From the choices at the top, choose **Individual components**.
32
32
1. Scroll down to the **Compilers, build tools, and runtimes** section.
@@ -37,8 +37,8 @@ To set up Visual Studio for cross-platform C++ development, install the build to
37
37
38
38
### On the remote machine
39
39
40
-
1. Install the remote tools on the remote machine. For this tutorial, install the ARM64 tools by following the instructions in [Download and Install the remote tools](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#download-and-install-the-remote-tools).
41
-
1. Start and configure the remote debugger on the remote machine. For this tutorial, do so by following the directions in [set up the remote debugger](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#BKMK_setup) on the remote Windows machine.
40
+
1. Install the remote tools on the remote machine. For this tutorial, install the ARM64 tools by following the instructions in [Download and Install the remote tools](/visualstudio/debugger/remote-debugging-cpp#download-and-install-the-remote-tools).
41
+
1. Start and configure the remote debugger on the remote machine. For this tutorial, do so by following the directions in [set up the remote debugger](/visualstudio/debugger/remote-debugging-cpp#BKMK_setup) on the remote Windows machine.
Abstract classes act as expressions of general concepts from which more specific classes can be derived. You cannot create an object of an abstract class type; however, you can use pointers and references to abstract class types.
9
+
Abstract classes act as expressions of general concepts from which more specific classes can be derived. You can't create an object of an abstract class type. However, you can use pointers and references to abstract class types.
11
10
12
-
A class that contains at least one pure virtual function is considered an abstract class. Classes derived from the abstract class must implement the pure virtual function or they, too, are abstract classes.
11
+
You create an abstract class by declaring at least one pure virtual member function. That's a virtual function declared by using the pure specifier (`= 0`) syntax. Classes derived from the abstract class must implement the pure virtual function or they, too, are abstract classes.
13
12
14
-
Consider the example presented in [Virtual Functions](../cpp/virtual-functions.md). The intent of class `Account` is to provide general functionality, but objects of type `Account` are too general to be useful. Therefore,`Account` is a good candidate for an abstract class:
13
+
Consider the example presented in [Virtual functions](../cpp/virtual-functions.md). The intent of class `Account` is to provide general functionality, but objects of type `Account` are too general to be useful. That means`Account` is a good candidate for an abstract class:
15
14
16
15
```cpp
17
16
// deriv_AbstractClasses.cpp
@@ -30,7 +29,7 @@ The only difference between this declaration and the previous one is that `Print
30
29
31
30
## Restrictions on abstract classes
32
31
33
-
Abstract classes cannot be used for:
32
+
Abstract classes can't be used for:
34
33
35
34
- Variables or member data
36
35
@@ -40,42 +39,46 @@ Abstract classes cannot be used for:
40
39
41
40
- Types of explicit conversions
42
41
43
-
Another restriction is that if the constructor for an abstract class calls a pure virtual function, either directly or indirectly, the result is undefined. However, constructors and destructors for abstract classes can call other member functions.
42
+
If the constructor for an abstract class calls a pure virtual function, either directly or indirectly, the result is undefined. However, constructors and destructors for abstract classes can call other member functions.
44
43
45
-
Pure virtual functions can be defined for abstract classes, but they can be called directly only by using the syntax:
44
+
## Defined pure virtual functions
45
+
46
+
Pure virtual functions in abstract classes can be *defined*, or have an implementation. You can only call such functions by using the fully qualified syntax:
46
47
47
48
*abstract-class-name*::*function-name*()
48
49
49
-
This helps when designing class hierarchies whose base class(es) include pure virtual destructors, because base class destructors are always called in the process of destroying an object. Consider the following example:
50
+
Defined pure virtual functions are helpful when you design class hierarchies whose base classes include pure virtual destructors. That's because base class destructors are always called during object destruction. Consider the following example:
50
51
51
52
```cpp
53
+
// deriv_RestrictionsOnUsingAbstractClasses.cpp
52
54
// Declare an abstract base class with a pure virtual destructor.
53
-
// deriv_RestrictionsonUsingAbstractClasses.cpp
54
-
class base {
55
+
// It's the simplest possible abstract class.
56
+
class base
57
+
{
55
58
public:
56
59
base() {}
57
-
virtual ~base()=0;
60
+
virtual ~base() = 0 {}; // pure virtual, and defined!
58
61
};
59
62
60
-
// Provide a definition for destructor.
61
-
base::~base() {}
62
-
63
-
class derived:public base {
63
+
class derived : public base
64
+
{
64
65
public:
65
66
derived() {}
66
-
~derived(){}
67
+
~derived(){}
67
68
};
68
69
69
-
int main() {
70
-
derived *pDerived = new derived;
71
-
delete pDerived;
70
+
int main()
71
+
{
72
+
derived aDerived; // destructor called when it goes out of scope
72
73
}
73
74
```
74
75
75
-
When the object pointed to by `pDerived` is deleted, the destructor for class `derived` is called and then the destructor for class `base` is called. The empty implementation for the pure virtual function ensures that at least some implementation exists for the function.
76
+
The example shows the definition of `~base()` inline, but you can also define it outside the class by using `base::~base() {}`.
77
+
78
+
When the object `aDerived` goes out of scope, the destructor for class `derived` is called. The compiler generates code to implicitly call the destructor for class `base` after the `derived` destructor. The empty implementation for the pure virtual function `~base` ensures that at least some implementation exists for the function. Without it, the linker generates an unresolved external symbol error for the implicit call.
76
79
77
80
> [!NOTE]
78
-
> In the preceding example, the pure virtual function `base::~base` is called implicitly from `derived::~derived`. It is also possible to call pure virtual functions explicitly using a fully qualified member-function name.
81
+
> In the preceding example, the pure virtual function `base::~base` is called implicitly from `derived::~derived`. It's also possible to call pure virtual functions explicitly by using a fully qualified member-function name. Such functions must have an implementation, or the call results in an error at link time.
description: "Learn more about: Fatal Error C1047"
3
3
title: "Fatal Error C1047"
4
-
ms.date: "11/04/2016"
4
+
ms.date: 02/17/2021
5
5
f1_keywords: ["C1047"]
6
6
helpviewer_keywords: ["C1047"]
7
-
ms.assetid: e1bbbc6b-a5bc-4c23-8203-488120a0ec78
8
7
---
9
8
# Fatal Error C1047
10
9
11
-
The object or library file 'file' was created with an older compiler than other objects; rebuild old objects and libraries
10
+
> The object or library file '*filename*' was created with an older compiler than other objects; rebuild old objects and libraries
12
11
13
-
C1047 is caused when object files or libraries built with **/LTCG** are linked together, but where those object files or libraries are built with different versions of the Visual C++ toolset.
12
+
This error can happen if you use a new version of the compiler to build your project, but don't do a clean rebuild of existing object files or libraries.
14
13
15
-
This can happen if you begin using a new version of the compiler but do not do a clean rebuild of existing object files or libraries.
14
+
## Remarks
16
15
17
-
To resolve C1047, rebuild all object files or libraries.
16
+
C1047 is caused when object files or libraries built by using **`/GL`** or **`/LTCG`** in different versions of the Visual Studio C/C++ compiler toolset get linked together. For example, you can't link a **`/LTCG`** library built by using Visual Studio 2019 version 16.7 to an app built by using Visual Studio 2019 version 16.8. Both the major and minor update numbers of the toolset used to compile the objects and libraries must match exactly.
17
+
18
+
To resolve C1047, rebuild all object files or libraries by using the same version of the toolset.
19
+
20
+
## See also
21
+
22
+
[`/GL` (Whole Program Optimization)](../../build/reference/gl-whole-program-optimization.md)\
Copy file name to clipboardExpand all lines: docs/error-messages/tool-errors/vectorizer-and-parallelizer-messages.md
+32-13Lines changed: 32 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ For information about reason codes, refer to the next part of this article.
17
17
| Informational message | Description |
18
18
|--|--|
19
19
| 5001 | Loop vectorized. |
20
-
| 5002 | Loop not vectorized due to reason '*description*'. |
20
+
| 5002 | Loop not vectorized because of reason '*description*'. |
21
21
| 5011 | Loop parallelized. |
22
-
| 5012 | Loop not parallelized due to reason '*description*'. |
22
+
| 5012 | Loop not parallelized because of reason '*description*'. |
23
23
| 5021 | Unable to associate loop with pragma. |
24
24
25
25
The following sections list possible reason codes for the parallelizer and vectorizer.
@@ -30,11 +30,12 @@ The 5*xx* reason codes apply to both the parallelizer and the vectorizer.
30
30
31
31
| Reason code | Explanation |
32
32
|--|--|
33
-
| 500 | A generic message that covers several cases—for example, the loop includes multiple exits, or the loop header doesn't end by incrementing the induction variable. |
33
+
| 500 | A generic message that covers several cases: For example, the loop includes multiple exits, or the loop header doesn't end by incrementing the induction variable. |
@@ -201,7 +220,7 @@ The 10*xx* reason codes apply to the parallelizer.
201
220
| 1005 | The `no_parallel` pragma was specified. |
202
221
| 1006 | This function contains OpenMP. Resolve it by removing any OpenMP in this function. |
203
222
| 1007 | The loop induction variable or the loop bounds aren't signed 32-bit numbers (`int` or `long`). Resolve it by changing the type of the induction variable. |
204
-
| 1008 | The compiler detected that this loop doesn't perform enough work to justify auto-parallelization. |
223
+
| 1008 | The compiler detected that this loop doesn't do enough work to justify auto-parallelization. |
205
224
| 1009 | The compiler detected an attempt to parallelize a "`do`-`while`" loop. The auto-parallelizer only targets "`for`" loops. |
206
225
| 1010 | The compiler detected that the loop is using "not-equals" (`!=`) for its condition. |
207
226
@@ -403,7 +422,7 @@ The 11*xx* reason codes apply to the vectorizer.
403
422
| Reason code | Explanation |
404
423
|--|--|
405
424
| 1100 | Loop contains control flow—for example, "`if`" or "`?:`". |
| 1101 | Loop contains a (possibly implicit) datatype conversionthat can't be vectorized. |
407
426
| 1102 | Loop contains non-arithmetic or other non-vectorizable operations. |
408
427
| 1103 | Loop body includes shift operations whose size might vary within the loop. |
409
428
| 1104 | Loop body includes scalar variables. |
@@ -423,7 +442,7 @@ void code_1100(int *A, int x)
423
442
424
443
for (int i=0; i<1000; ++i)
425
444
{
426
-
// straightline code is more amenable to vectorization
445
+
// straight line code is more amenable to vectorization
427
446
if (x)
428
447
{
429
448
A[i] = A[i] + 1;
@@ -550,7 +569,7 @@ The 12*xx* reason codes apply to the vectorizer.
550
569
551
570
| Reason code | Explanation |
552
571
|--|--|
553
-
| 1200 | Loop contains loop-carried data dependencies that prevent vectorization. Different iterations of the loop interfere with each other such that vectorizing the loop would produce wrong answers, and the auto-vectorizer can't prove to itself that there are no such data dependences. |
572
+
| 1200 | Loop contains loop-carried data dependencies that prevent vectorization. Different iterations of the loop interfere with each other such that vectorizing the loop would produce wrong answers, and the auto-vectorizer can't prove to itself that there aren't such data dependencies. |
554
573
| 1201 | Array base changes during the loop. |
555
574
| 1202 | Field in a struct isn't 32 or 64 bits wide. |
556
575
| 1203 | Loop body includes non-contiguous accesses into an array. |
@@ -642,7 +661,7 @@ The 13*xx* reason codes apply to the vectorizer.
642
661
643
662
| Reason code | Explanation |
644
663
|--|--|
645
-
| 1300 | Loop body contains no—or very little—computation. |
664
+
| 1300 | Loop body contains little or no computation. |
646
665
| 1301 | Loop stride isn't +1. |
647
666
| 1302 | Loop is a "`do`-`while`". |
648
667
| 1303 | Too few loop iterations for vectorization to provide value. |
@@ -692,7 +711,7 @@ int code_1303(int *A, int *B)
692
711
// make vectorization profitable.
693
712
694
713
// If the loop computation fits perfectly in
695
-
// vector registers - for example, the upperbound is 4, or 8 in
714
+
// vector registers - for example, the upper bound is 4, or 8 in
696
715
// this case - then the loop _may_ be vectorized.
697
716
698
717
// This loop is not vectorized because there are 5 iterations
Copy file name to clipboardExpand all lines: docs/overview/whats-new-cpp-docs.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ For the latest C++ conformance status, see [C++ conformance improvements in Visu
192
192
193
193
## Community contributors
194
194
195
-
The following people contributed to the C++, C, and Assembler docs during this period. Thank you! See [Microsoft Docs contributor guide overview](https://docs.microsoft.com/contribute/) if you'd like to learn how to contribute.
195
+
The following people contributed to the C++, C, and Assembler docs during this period. Thank you! See [Microsoft Docs contributor guide overview](/contribute/) if you'd like to learn how to contribute.
196
196
197
197
-[yecril71pl](https://github.com/yecril71pl) - Christopher Yeleighton (4)
198
198
-[definedrisk](https://github.com/definedrisk) - Ben (3)
0 commit comments