Προς το περιεχόμενο

Προτεινόμενες αναρτήσεις

  • Moderators
Δημοσ.

Άλλαξα πρόσφατα σε VS2012 επειδή υποστηρίζει C++11 αλλά επειδή δεν ξέρω ούτε C++11 ούτε το VS2012 χρειάζομαι τη βοήθειά σας. Έχω τον ακόλουθο κώδικα:

// cMapManager.cpp
bool cMapManager::loadMaps()
{
    bool ret = true;
    for (const auto& x : defs::map_paths)
    {

    }
    return ret;
}

// Defs.cpp
namespace defs
{
    /* . . . */
    std::map<std::string, std::string> map_paths;
}

Μπορεί να μου πει κάποιος γιατί μου βγάζει αυτά τα μηνύματα; Έχω κάνει copy-paste μέχρι και παραδείγματα από την MSDN, αλλά βγάζει τα ίδια!

1>c:\users\kercyn\desktop\tct\tct\cmapmanager.cpp(19): error C2143: syntax error : missing ',' before ':'
1>c:\users\kercyn\desktop\tct\tct\cmapmanager.cpp(19): error C2530: 'x' : references must be initialized
1>c:\users\kercyn\desktop\tct\tct\cmapmanager.cpp(19): error C3531: 'x': a symbol whose type contains 'auto' must have an initializer
1>c:\users\kercyn\desktop\tct\tct\cmapmanager.cpp(20): error C2143: syntax error : missing ';' before '{'
  • Moderators
Δημοσ.

Δε θα έπρεπε να γίνεται. Πόσταρε τα command line compiler options.

/GS /analyze- /W3 /Zc:wchar_t /ZI /Gm /Od /Fd"Debug\vc100.pdb" /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MD /Fa"Debug\" /EHsc /nologo /Fo"Debug\" /Fp"Debug\TCT.pch"
Δημοσ.

Λίγο WTF κατάσταση, δε βλέπω τίποτα που να το δικαιολογεί.

 

Αυτό σου κάνει compile?

 

int main() {
std::map<std::string, std::string> map_paths;


    for (const auto& x : map_paths)
    {


    }
}
  • Moderators
Δημοσ.

 

Λίγο WTF κατάσταση, δε βλέπω τίποτα που να το δικαιολογεί.

 

Αυτό σου κάνει compile?

 

int main() {
std::map<std::string, std::string> map_paths;


    for (const auto& x : map_paths)
    {


    }
}

 

 

Τσου.

Microsoft Visual Studio 2012 Ultimate

Version 11.0.60315.01 Update 2

Δημιουργήστε ένα λογαριασμό ή συνδεθείτε για να σχολιάσετε

Πρέπει να είστε μέλος για να αφήσετε σχόλιο

Δημιουργία λογαριασμού

Εγγραφείτε με νέο λογαριασμό στην κοινότητα μας. Είναι πανεύκολο!

Δημιουργία νέου λογαριασμού

Σύνδεση

Έχετε ήδη λογαριασμό; Συνδεθείτε εδώ.

Συνδεθείτε τώρα
  • Δημιουργία νέου...