Recommended Posts

可是上面

#include "stdafx.h"

using namespace System;

是vc++2010一開專案就預先寫好的了

-----------------------------------

如果加入#include<iosteam>;using namespace std;之後如下

// Learn.cpp: 主要專案檔。

#include "stdafx.h";

#include"iosteam";

using namespace std;

int main(array<System::String ^> ^args)

{

cout<<"hello";

return 0;

}

錯誤顯示:

1>Learn.cpp(4): warning C4067: 未預期的語彙基元,接著前置處理器指示詞 - 必須是新行

1>Learn.cpp(4): fatal error C1083: 無法開啟包含檔案: 'iosteam': No such file or directory

-------------------------------

如果刪除#include "stdafx.h"再加上#include<iosteam>;using namespace std;之後如下

// Learn.cpp: 主要專案檔。

#include"iosteam";

using namespace std;

int main(array<System::String ^> ^args)

{

cout<<"hello";

return 0;

}

錯誤如下:

1>Learn.cpp(4): warning C4627: '#include "iosteam"': 尋找先行編譯標頭使用時略過

1> 新增指示詞到 'StdAfx.h' 或重建先行編譯標頭

1>Learn.cpp(14): fatal error C1010: 尋找先行編譯標頭檔指示詞時碰到未預期的檔案結尾。您的原始檔中是否忘了加上 '#include "StdAfx.h"'?

----------------------------

如果不改using namespace std;直接加#include"iosteam";則

// Learn.cpp: 主要專案檔。

#include "stdafx.h";

#include"iosteam";

using namespace System;

int main(array<System::String ^> ^args)

{

cout<<"hello";

return 0;

}

錯誤:

1>Learn.cpp(4): warning C4067: 未預期的語彙基元,接著前置處理器指示詞 - 必須是新行

1>Learn.cpp(4): fatal error C1083: 無法開啟包含檔案: 'iosteam': No such file or directory

-------------------------------

小弟高一就碰了C++

結果荒廢了兩年後

只好靠大大幫忙了

小弟猜會不會是2010版本的問題???

鏈接文章
分享到其他網站
...........

VS2010版

-------------------------------

#include "stdafx.h"

#include <iostream>

int _tmain(int argc,_TCHAR argv[])

{

std::cout<<"Hello !!!!!!樓主XD";

getchar();//或system("PAUSE");

return 0;

}

有怪怪的喔

要改成

int main(array<System::String ^> ^args)

謝謝囉

不過....為什麼要加 std:: 才能動??

???

鏈接文章
分享到其他網站
  • 1 month later...

請登入後來留意見

在登入之後,您才能留意見



立即登入