我使用GCC 4.6.3:致命錯誤:iostream.h:沒有這樣的文件或目錄
[email protected]:~$ g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
我的計劃會導致以下編譯錯誤:
[email protected]:~$ g++ ArrayInput.cpp
ArrayInput.cpp:1:21: fatal error: iostream.h: No such file or directory
如何解決它?
通常要使用''包括。也許他們已經在默認包含路徑? –
解決問題並重新編譯我得到這個錯誤: - gourab @ gourab-RV509:〜$ g ++ ArrayInput.cpp ArrayInput.cpp:在函數'int main()': ArrayInput.cpp:5:2:error: 'cout'未在此範圍內聲明 ArrayInput.cpp:5:2:note:建議的替代方案: /usr/include/c++/4.6/iostream:62:18:note:'std :: cout' ArrayInput。 cpp:8:5:error:'cin'未在此範圍內聲明 ArrayInput.cpp:8:5:note:建議的替代方案: /usr/include/c++/4.6/iostream:61:18:note:' std :: cin' –
@ grv.giit您正在使用哪本書? – asheeshr