redefinition

    1熱度

    2回答

    請幫我解決這個奇怪的編譯錯誤。我正在爲我的班級學生重新定義運營商< <爲 ,但在「s.name」處出現此錯誤。變量s.name是一個字符串... ostream &operator<<(ostream& output, Student &s) { output<<"\nIme: "<<s.name<<"\nFakulteten nomer: "<<s.fakn<<"\nSreden uspeh

    1熱度

    2回答

    我有好幾個文件,而且我的錯誤很奇怪。我不知道它是否會成爲問題的一部分,我使用XCode與OpenGL/SDL一起工作,並使用CMake創建了這些文件。 我有文件Wall.hpp,Wall.cpp,Player.hpp,Player.cpp,controls.hpp,controls.cpp,main.cpp。 這裏是文件夾雜物的總結: // Player.hpp #include <iostrea

    1熱度

    3回答

    使用首先檢查它是否已被定義的函數會在任何Webkit瀏覽器下出現問題。 有時我使用js模塊A中的函數,而在另一個應用程序中,我希望使用與模塊B具有相同名稱(但代碼略有不同)的相同函數。 我通過typeof運算符來解決此問題,以檢查它是否「未定義」。 下面的例子(爲了清晰起見,在一個文件中)顯示了我所做的。 <!DOCTYPE html> <html> <head> <title>Javasc

    3熱度

    2回答

    我繼續之前,這裏是它給了我一個錯誤代碼: #define numScores 3 // the number of test scores which a student will have struct btreenode{ int studentID; // the ID number of the student at the current node float sc

    0熱度

    2回答

    我有2個頭需要定義2個相似的結構。一個結構應該對齊到32字節,其他結構相似,但不需要對齊到32字節,這樣我就可以在這裏保存一些內存。其中一個包含在另一箇中。這裏是main_header.h struct mainStruct { int a; int b; int c; char pad[20]; }; 以下是sub_header.h #includ

    0熱度

    1回答

    我試圖將一些遺留代碼遷移到一個較新的項目中,但我並沒有真正弄清楚這個問題。代碼在舊環境中編譯和運行良好。 我有一個包含這些定義一個頭文件: std::string ToString(shared_ptr<const SomeObject> obj); std::string ToString(SomeObject* obj); 而且具有以下幾行實現文件:我試圖用clang編譯它 using

    8熱度

    1回答

    我有一個問題。我使用Visual Studio 2013並得到以下錯誤: Error C2371: 'getgrundflaeche' redefinition: different basic types. 我不知道爲什麼我得到這個錯誤。當我嘗試調用函數getgrundflaeche()時,我得到與VS12相同的錯誤。 這裏是代碼: #include <stdio.h> #define P

    1熱度

    1回答

    的重新定義當我嘗試編譯我的代碼我得到: thread-support.cpp: At global scope: thread-support.cpp:18: error: redefinition of ‘Semaphore* Mutex’ thread.h:15: error: ‘Semaphore* Mutex’ previously declared here thread-supp

    0熱度

    1回答

    的重新定義我得到這個錯誤: Redefinition of 'NSString' as different kind of symbol at line: extern NSString * const ADErrorDomain; in ADBannerView.h 它用來工作,有沒有事做交換的SDK?從ios6到ios7?

    1熱度

    3回答

    爲什麼MSVS拒絕編譯以下內容? 的config.h char *names[][2] = { { "Marry", "McBlith" }, { "Nadja", "Nurales"} }; 的main.c #include <Windows.h> #include <stdio.h> #include "config.h" int main() {