2012-03-14 192 views
1

這裏’使用前」預期不合格的ID」是我的代碼:編譯器錯誤:「‘

//test file 
    #include <iostream> 
    #include "stat.h" 
    #include "frequency.h" 

    using namespace std; 

    int main(){ 
     cout << "helo"<< endl; 
     return 0; 
    } 

當我嘗試編譯,我得到:

test.cc:7: error: expected unqualified-id before "using" 
    test.cc:7: error: expected `,' or `;' before "using" 

任何想法是怎麼回事?在這裏

+7

你缺少' 「frequency.h」'分號。 – Mysticial 2012-03-14 05:23:37

+1

''frequency.h''中最後一個類的定義似乎在其主體末尾缺少';'。 – iammilind 2012-03-14 05:24:13

+0

我不認爲;是包含在Visual Studio中所必需的。也許@ beachwood23應該提供一些更多的細節。 – 2012-03-14 06:18:08

回答

8

你可能錯過了;在E頭文件的nd。

它應該是這樣的:

class frequency { 
     ... 
}; 
2

這個問題可能在frequency.h最後一行的錯誤