错误代码为:
```c++
/
#ifndef _SSP_STRING_H
#define _SSP_STRING_H 1
#include_netx "string.h"
#if __SSP_FORTIFY_LEVEL > 0
#undef memcpy
#undef memmove
#undef memset
#undef strcat
#undef strcpy
#undef strncat
#undef strncpy
#undef mempcpy
#undef stpcpy
#undef bcopy
#undef bzero
#define memcpy(dest, src, len) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___memcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
: __memcpy_ichk (dest, src, len))
static inline __attribute__((__always_inline__)) void *
__memcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
size_t __len)
{
return __builtin___memcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
}
#define memmove(dest, src, len) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
: __memmove_ichk (dest, src, len))
static inline __attribute__((__always_inline__)) void *
__memmove_ichk (void *__dest, const void *__src, size_t __len)
{
return __builtin___memmove_chk (__dest, __src, __len, __ssp_bos0 (__dest));
}
#define mempcpy(dest, src, len) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___mempcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
: __mempcpy_ichk (dest, src, len))
static inline __attribute__((__always_inline__)) void *
__mempcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
size_t __len)
{
return __builtin___mempcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
}
#define memset(dest, ch, len) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___memset_chk (dest, ch, len, __ssp_bos0 (dest)) \
: __memset_ichk (dest, ch, len))
static inline __attribute__((__always_inline__)) void *
__memset_ichk (void *__dest, int __ch, size_t __len)
{
return __builtin___memset_chk (__dest, __ch, __len, __ssp_bos0 (__dest));
}
#define bcopy(src, dest, len) ((void) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
: __memmove_ichk (dest, src, len)))
#define bzero(dest, len) ((void) \
((__ssp_bos0 (dest) != (size_t) -1) \
? __builtin___memset_chk (dest, '\0', len, __ssp_bos0 (dest)) \
: __memset_ichk (dest, '\0', len)))
#define strcpy(dest, src) \
((__ssp_bos (dest) != (size_t) -1) \
? __builtin___strcpy_chk (dest, src, __ssp_bos (dest)) \
: __strcpy_ichk (dest, src))
static inline __attribute__((__always_inline__)) char *
__strcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
{
return __builtin___strcpy_chk (__dest, __src, __ssp_bos (__dest));
}
#define stpcpy(dest, src) \
((__ssp_bos (dest) != (size_t) -1) \
? __builtin___stpcpy_chk (dest, src, __ssp_bos (dest)) \
: __stpcpy_ichk (dest, src))
static inline __attribute__((__always_inline__)) char *
__stpcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
{
return __builtin___stpcpy_chk (__dest, __src, __ssp_bos (__dest));
}
#define strncpy(dest, src, len) \
((__ssp_bos (dest) != (size_t) -1) \
? __builtin___strncpy_chk (dest, src, len, __ssp_bos (dest)) \
: __strncpy_ichk (dest, src, len))
static inline __attribute__((__always_inline__)) char *
__strncpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
size_t __len)
{
return __builtin___strncpy_chk (__dest, __src, __len, __ssp_bos (__dest));
}
#define strcat(dest, src) \
((__ssp_bos (dest) != (size_t) -1) \
? __builtin___strcat_chk (dest, src, __ssp_bos (dest)) \
: __strcat_ichk (dest, src))
static inline __attribute__((__always_inline__)) char *
__strcat_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
{
return __builtin___strcat_chk (__dest, __src, __ssp_bos (__dest));
}
#define strncat(dest, src, len) \
((__ssp_bos (dest) != (size_t) -1) \
? __builtin___strncat_chk (dest, src, len, __ssp_bos (dest)) \
: __strncat_ichk (dest, src, len))
static inline __attribute__((__always_inline__)) char *
__strncat_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
size_t __len)
{
return __builtin___strncat_chk (__dest, __src, __len, __ssp_bos (__dest));
}
#endif /* __SSP_FORTIFY_LEVEL > 0 */
#endif /* _SSP_STRING_H */
这是一个头文件文件在使用过程中出现了c1021的错误(非vs原头文件)这是DEV—c++的头文件,不知道为什么被VS2022拿来用了
错误 :C1021 无效的预处理器命令“include_netx”
为支持的程序:
```c++
// 游戏.cpp : 定义应用程序的入口点。
//
#include "framework.h"
#include "游戏.h"
#define MAX_LOADSTRING 100
// 全局变量:
HINSTANCE hInst; // 当前实例
WCHAR szTitle[MAX_LOADSTRING]; // 标题栏文本
WCHAR szWindowClass[MAX_LOADSTRING]; // 主窗口类名
// 此代码模块中包含的函数的前向声明:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: 在此处放置代码。
// 初始化全局字符串
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadStringW(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// 执行应用程序初始化:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY));
MSG msg;
// 主消息循环:
while (GetMessage(&msg, nullptr, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// 函数: MyRegisterClass()
//
// 目标: 注册窗口类。
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEXW wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MY));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassExW(&wcex);
}
//
// 函数: InitInstance(HINSTANCE, int)
//
// 目标: 保存实例句柄并创建主窗口
//
// 注释:
//
// 在此函数中,我们在全局变量中保存实例句柄并
// 创建和显示主程序窗口。
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // 将实例句柄存储在全局变量中
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// 函数: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// 目标: 处理主窗口的消息。
//
// WM_COMMAND - 处理应用程序菜单
// WM_PAINT - 绘制主窗口
// WM_DESTROY - 发送退出消息并返回
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
{
int wmId = LOWORD(wParam);
// 分析菜单选择:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
// TODO: 在此处添加使用 hdc 的任何绘图代码...
EndPaint(hWnd, &ps);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
// “关于”框的消息处理程序。
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
这个文件未出错
有人知道错处在哪里嘛?