VC2010 编译问题
VS2010 C++错误处理办法(转载)
错误:
fatal error C1010: unexpected endof file while looking for precompiled header. Did you forget toadd '#include"StdAfx.h"' to your source?
#include"StdAfx.h" 你把这个放在头文件里面就行了
2 vc++编程出现错误error C2447: missing function header (old-styleformal list?)
原因:函数后面多了分号;
SUNSHINE_APISSN_RETURN SsnWriteProfileString(__in INT nPlugInId, __in_opt LPTSTRlpszGroupName, __in LPTSTR lpszKey, __in LPTSTR lpszValue);
3 errorC2491: 'SsnWriteProfileString' : definition of dllimport function not allowed
错误C2491:“SsnWriteProfileString’:dllimport函数的定义不允许的
SUNSHINE_API SSN_RETURNSsnWriteProfileString(__in INT nPlugInId, __in_opt LPTSTR lpszGroupName, __inLPTSTR lpszKey, __in LPTSTR lpszValue)
查看SUNSHINE_API在 .h文件中的定义
#ifdefSSNAPI_EXPORTS
#define SUNSHINE_API __declspec(dllexport)
#else
#define SUNSHINE_API __declspec(dllimport)
#endif
将#ifdef SSNAPI_EXPORTS添加到#include<stdafx.h>的下面;形如:
#include<stdafx.h>
#defineSSNAPI_EXPORTS
则解决;
4 error C2065: “CString”:未声明的标识符
(1)如果你使用VC.net那么:使用MFC:包含cstringt.h;不使用MFC:包含atlstr.h
5 error C2065: 'DEBUG_NEW' : undeclared identifier?
static char THIS_FILE[]=__FILE__;
error C2440: 'initializing' : cannot convert from 'constchar [34]' to 'TCHAR [128]'
错误C2440:“初始化”:不能把'字符常量[34]' ' TCHAR[128]'
在vs2010下设置unicode编译选项,去掉unicode模式,具体设置方法为:
project->Properties->ConfigurationProperties->General->Character Set->Not Set
http://blog.csdn.net/hrh2010/article/details/6681271
C1083:Cannot open include file: 'stdafx.h': No such file or directory
C1083:无法打开包括文件:“stdafx.h中”:没有这样的文件或目录
8 error C2065: “cout”: 未声明的标识符
error C3872: '0x3000': thischaracter is not allowed in an identifier
0x3000是汉语的空格,也就是全角空格,相当于一个汉字,但你又看不见它。
你知道的,像逗号,有半角(,)和全角(,)之分的,其实空格也有。
你最好把这个语句的后面空白部分,都删除掉,免得有不可见的全角空格。
_stprintf_s(filename,MAX_PATH, _T("C:\\Program\\rwini_%d.ini"),nPlugInId);
_T("C:\\Program\\rwini_%d.ini") 相当于 LPTSTR
fatal error C1083: 无法打开预编译头文件:“Debug/UGFace.pch”: No such file or directory
解决方法:修改:项目->属性->C/C++->预编译头->不使用预编译头即可。
错误是CsaveFileNameA没有实现,即没有写CsaveFileNameA构造函数和析构函数
1>e:\gc\src\core\inifile.h(344):error C2143: syntax error : missing ';' before '*'
CIniFileW* PIniFile;应用的类在该类的下面,未定义;
// Added forversions earlier than VS2008
#ifdefined(_MSC_VER) && (_MSC_VER <= 1400)
CsaveFileNameW( CFileNameW* pIniFile , const std::wstring& sFileName );
CsaveFileNameW( constCsaveFileNameW& );// No Copy
CsaveFileNameW&operator=(constCsaveFileNameW&);// No Copy
booloperator()(const CsaveFileNameW* s1,const CsaveFileNameW* s2)const
returnwcscasecmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;
return_wcsicmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;
typedefstd::set<CsaveFileNameW*,ci_less_w> FileIndexW;
#ifdefined(_MSC_VER) && (_MSC_VER >= 1200)&& (_MSC_VER < 1300)
CsaveFileNameW* GetFileName( std::wstringsFileName );
//CsaveFileNameW*GetFileName( std::wstring sFileName ) const;
FileIndexW::const_iterator _find_file( const std::wstring& sFileName ) const;
FileIndexW::iterator _find_file( conststd::wstring& sFileName );
// Usedto save the data back to the file or your choice
bool Save( conststd::wstring& fileName );
// Added forversions earlier than VS2008
#ifdefined(_MSC_VER) && (_MSC_VER <= 1400)
CsaveFileNameW( CFileNameW* pIniFile , const std::wstring& sFileName );
CsaveFileNameW( constCsaveFileNameW& );// No Copy
CsaveFileNameW&operator=(constCsaveFileNameW&);// No Copy
booloperator()(const CsaveFileNameW* s1,const CsaveFileNameW* s2)const
returnwcscasecmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;
return_wcsicmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;
typedefstd::set<CsaveFileNameW*,ci_less_w> FileIndexW;
#ifdefined(_MSC_VER) && (_MSC_VER >= 1200)&& (_MSC_VER < 1300)
CsaveFileNameW* GetFileName( std::wstringsFileName );
//CsaveFileNameW*GetFileName( std::wstring sFileName ) const;
FileIndexW::const_iterator _find_file( const std::wstring& sFileName ) const;
FileIndexW::iterator _find_file( conststd::wstring& sFileName );
// Usedto save the data back to the file or your choice
bool Save( conststd::wstring& fileName );
error C2248:'CFileNameW::CsaveFileNameW::PIniFile' : cannot access privatemember declared in class 'CFileNameW::CsaveFileNameW'
错误C2248:“CFileNameW::::PIniFileCsaveFileNameW”:不能访问私有成员中声明的类的CFileNameW::CsaveFileNameW”
15 error C2440: 'initializing' : cannot convert from 'wchar_t *' to 'TCHAR'
16 warning C4627: '#include <math.h>': skipped when looking for precompiled header use
CString与char的转换问题,用强制转换报了如下错误,应该如何进行转换呢?
TCItem.item.pszText= "ok ";//显示正常
TCItem.item.pszText=(char)strName;//报如下错误
18 关于VC 的 error C3872: '0x3000':
Error 1 error C3872: '0x3000': this character is not allowed in an identifier
#include<iostream>
using namespace std;
错误代表同一个工程里,有两个PiShowListDialog函数!
致命错误C1010:在寻找预编译指示头文件时,文件未预期结束。
22 error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
2 动态调用DLL
通过
LoadLibrary
GetProcAddress
FreeLibrary实现。
1、工程属性->配置属性–>常规—>字符集—->使用多字节符字符集
错误 error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
解决方法:
AfxMessageBox(_T("click"));
解释:如果程序中define _UNICODE,则可用_T or _TEXT将后面的内容转为UNICODE格式字符串,否则和不用_T一样
转载于:https://www.cnblogs.com/Dennis-mi/articles/4157095.html
VC2010 编译问题相关推荐
- Windows 7下vc2010编译使用redis 3.0
Windows 7下vc2010编译使用redis 3.0 项目中,有多台机器频繁读写.同步一些参数.起初的方案是通过MySQL的临时表实现,对效率有一些影响,故改为redis方案.项目中redis和 ...
- VC2010编译boost
BOOST已经开始支持VC2010,也有人称之为VC10或者MSC16.在这里谷主介绍下BOOST的编译过程,BOOST跨平台做的很棒,所以我们编译起来其实很简单. 1.下载BOOST发行版或SVN代 ...
- vc2010编译openssl
最近的项目需要用到openssl支撑,手头到是有32版本的库,但是还需要64位版本,于是又到处查资料解决如何编译openssl库,查了不少资料,算是解决编译问题了. 1. 下载openssl开源库 2 ...
- VC2010 编译 Media Player Classic - BE (mpc-be)
Media Player Classic - BE (mpc-be)播放器是基于Media Player Classic - Home Cinema (mpc-hc)的播放器,它是开源的.是俄国人写的 ...
- VC2010 编译 Media Player Classic - Home Cinema (mpc-hc)
Media Player Classic - Home Cinema (mpc-hc)播放器一个经典的影音播放器,免费软件,可播放CD.VCD.DVD.及MP3.MP4.AVI.AAC等多种影音格式. ...
- windows VC2010编译libwebsockets
1. 下载cmake: https://cmake.org/files/v3.10/ 版本:cmake-3.10.0-win32-x86.msi/cmake-3.10.1-win64-x64 我安装了 ...
- vs2010c语言运行按钮在哪,Visual C++2010如何编写并运行C++程序,vc2010编译按钮在哪里...
Visual C++2010如何编写并运行C++程序如何在visual c 2010中编写和运行c程序,Visual C 2010中C程序的编写和运行方法:首先打开编辑器,新建一个项目,输入名称和保存 ...
- VC++编译zlib
目录 第1章简介 1 第2章版本1.2.3 2 2.1 编译汇编代码 2 2.1.1 32位汇编 2 2.1.2 64位汇编 5 2.2 Visual C++ 6.0 ...
- C++二维码相关库编译
一.瞎想 坐在地铁上闲来无聊,突然想到了二维码,顺手就百度了下相关的资料,目前C++二维码相关的库不多,也就zbar(开源中国上下了半天也没下载下来).zxing,不过这两个库据说都是解析二维码的,不 ...
最新文章
- python 多维数组的排序
- Win10開始菜单打不开
- abp 打包部署到ubuntu_如何在Ubuntu中安装Docker和运行 Docker容器
- 【渝粤教育】广东开放大学 社会调查与方法 形成性考核 (35)
- 最小值c语言 循环,C语言循环结构
-C语言求全班同学身高的最大值和最小值
- python怎么用第三方库_python中第三方库的下载方法
- TensorFlow第五步:返回起点、深挖坑,解刨一个麻雀。
- pg 日期和时间的运算操作
- Android 解决通过自定义设置打开热点后手机搜索不到热点的问题。
- python︱Python进程、线程、协程详解、运行性能、效率(tqdm)
- 29. PHP 错误控制
- 如何导出python所有的安装包
- 廖雪峰Python教程梳理
- Web前端之HTML取色器
- vue项目结构目录简介
- DVR NVR CVR有什么区别
- app瘦身值图片压缩
- Centos7下安装MPlay和VLC
- Guideline 4.0 - Design We noticed an issue in your app that contributes to a lower quality
- 软件测试-软件测试总结