Comments (9)
引用注意下顺序……先要BaseFunction 要在Windows之后
from cpphelper.
哦哦 终于编译通过了 😂。
原因是:我把原来的头文件引用内容都删掉了。
需要在 stdafx.h 中 最下方添加(保留所有原始的引用)。
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料
// Windows 头文件:
//nuklear
#include <windows.h>
// C 运行时头文件
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <BaseFunction.h> //添加在此处
其次:
项目属性中>配置属性>常规>项目默认值>字符集 必须是 使用Unicode字符集。
以及 项目属性中>配置属性>C/C++>代码生成>运行库 必须使用 多线程调试 (/MTd) 或者 多线程调试 DLL (/MDd) 。
感谢作者指点 😀。
from cpphelper.
哈哈 这都可以
from cpphelper.
@mingkuang-Chuyu debug 模式下 main 可以通过
release 模式下 需要 添加WinMain
反之 Debug 只有WinMain 没有 main 也是如此。
当然也可能和 我用 作者的 VC-LTL 库 有关系。。。。
from cpphelper.
这是你的工程设置问题WinMain是Windows应用程序入口函数,而main 是CUI入口函数
所以你的工程Debug跟Release的编译选项不一致导致了这个问题。
关闭此问题
from cpphelper.
@mingkuang-Chuyu 有没有 考虑 过 何时 添加 vcpkg 支持
from cpphelper.
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(3828): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\string.h(133): note: 参见“strcpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(3861): error C4996: 'wcscat': This function or variable may be unsafe. Consider using wcscat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(100): note: 参见“wcscat”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(3892): error C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(3894): error C4996: 'wcscat': This function or variable may be unsafe. Consider using wcscat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(100): note: 参见“wcscat”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(3959): error C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(4074): error C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(4130): error C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(123): note: 参见“wcscpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\unzip.cpp(4205): error C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\corecrt_wstring.h(205): note: 参见“wcsncpy”的声明
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\base.cpp(1189): warning C4018: “>”: 有符号/无符号不匹配
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\base.cpp(1733): warning C4244: “参数”: 从“UINT64”转换到“WPARAM”,可能丢失数据
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\base.cpp(2860): warning C4018: “<=”: 有符号/无符号不匹配
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\base.cpp(2898): warning C4018: “<=”: 有符号/无符号不匹配
1>c:\users\soar\source\repos\cpp\3dr\cpphelper\base.cpp(2996): error C4996: 'GetVersionExW': 被声明为已否决1>c:\users\soar\source\repos\cpp\3dr\cpphelper\wininethelper.cpp(471): error C4996: 'swscanf': This function or variable may be unsafe. Consider using swscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
上面的问题 除了 error C4996: 'GetVersionExW': 被声明为已否决 这个问题都已经解决了
请问这个问题要怎么解决,我不想仅仅只是禁用警告或者错误的方式来解决的话。需要怎么做。
引用 https://github.com/Chuyu-Team/YY-Thunks 这个库来解决吗?
PS:我并不需要兼容XP 只需要win7以上即可。
from cpphelper.
吧警告 视为错误关闭就可以了,要么压制特定错误。
GetVersionExW这个是用来判断是否运行在兼容模式的。
from cpphelper.
YY-Thunks只是来解决API不存在问题,比如XP调用了Vista里面才存在的API或者Win7调用了Win10 ARM里面才存在的API。但是不能阻止警告发生。
from cpphelper.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpphelper.