1;在VS2005里写个最简单的语句
MessageBox("Hello,World!");
出现错误提示:
error C2664: ‘CWnd::MessageBoxW’: cannot convert parameter 1 from ‘const char [13]‘ to ‘LPCTSTR’
查找到解决方法是改成
MessageBox(_T("Hello,World!"));或MessageBox(TEXT(“…”))
因为2005中默认的是unicode的,char是非unicode的。
MessageBox("Hello,World!")
可以在VS2005项目属性中改变设置 General->Character Set->Not Set
2;C++问题: fatal error C1083: Cannot open include file: '': No such file or directory
悬赏分:20 - 解决时间:2009-12-30 20:50
// #include <> double power (double x, int n); int main() { cout << "5 to the power 2 is " << power(5,2) << endl; //函数调用作为一个表达式出现在输出语句中。} double power (double x, int n) { double val = ; while (n--) val *= x; return(val); } 运行时出现如下情况--------------------Configuration: 3_1 - Win32 Debug-------------------- Compiling... c:\c++\代码\example\例题源代码\ch03\(2) : fatal error C1083: Cannot open include file: '': No such file or directory 执行 时出错. - 1 error(s), 0 warning(s) 求各路C++大侠帮忙解决要具体一点嘿嘿
问题补充:
已经将#include <>改为#include <iostream> using namespace std; //必须分两行
明白了以下几点,问题就搞清楚了: 1、要区分标准C的库和标准C++的库。iostream是C++的库,。 2、新的C++,。 3、在早期的vs版本,,用的还是老版本的C++标准库,,并且当时标准库也没有引入名字空间。因此直接#include <>是可以的。但到了vs2005,使用了新的C++标准库,只能用#include <iostream>。 4、名字空间里可以包含很多东西,比如函数名、标识符、数据类型
VS2005使用问题记录 来自淘豆网www.taodocs.com转载请标明出处.