|
1 | 1 | --- |
2 | 2 | title: "Compiler Warning (level 2) C4275" |
3 | | -ms.date: "11/04/2016" |
| 3 | +ms.date: "02/08/2019" |
4 | 4 | f1_keywords: ["C4275"] |
5 | 5 | helpviewer_keywords: ["C4275"] |
6 | 6 | ms.assetid: 18de967a-0a44-4dbc-a2e8-fc4c067ba909 |
7 | 7 | --- |
8 | 8 | # Compiler Warning (level 2) C4275 |
9 | 9 |
|
10 | | -non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' |
| 10 | +> non - DLL-interface class '*class_1*' used as base for DLL-interface class '*class_2*' |
11 | 11 |
|
12 | | -An exported class was derived from a class that was not exported. |
| 12 | +An exported class was derived from a class that wasn't exported. |
13 | 13 |
|
14 | | -To minimize the possibility of data corruption when exporting a class with [__declspec(dllexport)](../../cpp/dllexport-dllimport.md), ensure that: |
| 14 | +To minimize the possibility of data corruption when exporting a class with [__declspec(dllexport)](../../cpp/dllexport-dllimport.md), make sure that: |
15 | 15 |
|
16 | 16 | - All your static data is accessed through functions that are exported from the DLL. |
17 | 17 |
|
18 | 18 | - No inlined methods of your class can modify static data. |
19 | 19 |
|
20 | | -- No inlined methods of your class use CRT functions or other library functions use static data. |
| 20 | +- No inlined methods of your class use CRT functions or other library functions that use static data. |
21 | 21 |
|
22 | | -- No inlined class functions use CRT functions, or other library functions, where, for example, you access static data. |
| 22 | +- No inlined class functions use CRT functions, or other library functions, where you access static data. |
23 | 23 |
|
24 | 24 | - No methods of your class (regardless of inlining) can use types where the instantiation in the EXE and DLL have static data differences. |
25 | 25 |
|
26 | 26 | You can avoid exporting classes by defining a DLL that defines a class with virtual functions, and functions you can call to instantiate and delete objects of the type. You can then just call virtual functions on the type. |
27 | 27 |
|
28 | | -C4275 can be ignored in Visual C++ if you are deriving from a type in the C++ Standard Library, compiling a debug release (**/MTd**) and where the compiler error message refers to _Container_base. |
| 28 | +C4275 can be ignored in Visual C++ if you are deriving from a type in the C++ Standard Library, compiling a debug release (**/MTd**) and where the compiler error message refers to `_Container_base`. |
29 | 29 |
|
30 | | -``` |
| 30 | +```cpp |
31 | 31 | // C4275.cpp |
32 | 32 | // compile with: /EHsc /MTd /W2 /c |
33 | 33 | #include <vector> |
|
0 commit comments