Недавно я установил (последние сборки) Eclipse IDE для разработчиков C/С++ и minGW (4.8.1), чтобы помочь мне вернуться на С++ после долгого времени.
Я добавил -std=c++11
в Other flags
в C/C++ Build/Settings/Tool Settings/GCC C++ Compiler/Miscellaneous
У меня есть небольшая программа, использующая множество функций С++ 11 (например, используя библиотеку chrono
, .emplace_back
).
После запуска я получаю несколько неразрешенных проблем в окне "Проблемы", как показано ниже).
Интересно, что программа компилируется и запускается нормально.
-
С этим, есть ли что-то, что я не настраиваю в Eclipse для решения этих проблем?
-
Кто-нибудь знает, есть ли проблема с функцией
to_string()
в minGW (4.8.1), например. следующее не компилируется:window.setTitle("Bullets on screen: " + to_string(bullets.size()) + " currentSlice: " + to_string(currentSlice) + " FT: " + to_string(ft) + " FPS: " + to_string(fps) );
Он компилируется с использованием Visual Studio Express 2013 (хотя он имеет проблему с точностью библиотеки
chrono
, следовательно, переключается на minGW).Спасибо.
Выход окна Eclipse 'Problem':
Description Resource Path Location Type
Symbol 'duration' could not be resolved chronotest.cpp /chronotest/src line 19 Semantic Error
Function 'now' could not be resolved Test2.cpp /Test2/src line 143 Semantic Error
Function 'duration_cast' could not be resolved Test2.cpp /Test2/src line 160 Semantic Error
Function 'now' could not be resolved Test2.cpp /Test2/src line 158 Semantic Error
Symbol 'chrono' could not be resolved Test2.cpp /Test2/src line 8 Semantic Error
Type 'std::centi' could not be resolved chronotest.cpp /chronotest/src line 20 Semantic Error
Type 'std::chrono::seconds' could not be resolved chronotest.cpp /chronotest/src line 24 Semantic Error
Type 'std::time_t' could not be resolved chronotest.cpp /chronotest/src line 48 Semantic Error
Symbol 'duration' could not be resolved chronotest.cpp /chronotest/src line 47 Semantic Error
Function 'now' could not be resolved chronotest.cpp /chronotest/src line 44 Semantic Error
Function 'now' could not be resolved chronotest.cpp /chronotest/src line 39 Semantic Error
Type 'std::chrono::system_clock' could not be resolved chronotest.cpp /chronotest/src line 38 Semantic Error
Function 'end' could not be resolved Test2.cpp /Test2/src line 214 Semantic Error
Symbol 'time_point' could not be resolved chronotest.cpp /chronotest/src line 38 Semantic Error
Function 'end' could not be resolved Test2.cpp /Test2/src line 212 Semantic Error
Type 'milli' could not be resolved Test2.cpp /Test2/src line 161 Semantic Error
Method 'count' could not be resolved Test2.cpp /Test2/src line 161 Semantic Error
Symbol 'duration_cast' could not be resolved Test2.cpp /Test2/src line 160 Semantic Error
Symbol 'duration' could not be resolved Test2.cpp /Test2/src line 161 Semantic Error
Method 'count' could not be resolved chronotest.cpp /chronotest/src line 51 Semantic Error
Symbol 'duration_cast' could not be resolved chronotest.cpp /chronotest/src line 30 Semantic Error
Method 'count' could not be resolved chronotest.cpp /chronotest/src line 30 Semantic Error
Function 'to_time_t' could not be resolved chronotest.cpp /chronotest/src line 48 Semantic Error
Method 'count' could not be resolved chronotest.cpp /chronotest/src line 32 Semantic Error
Function 'ctime' could not be resolved chronotest.cpp /chronotest/src line 50 Semantic Error
Method 'count' could not be resolved chronotest.cpp /chronotest/src line 33 Semantic Error
Symbol 'duration' could not be resolved chronotest.cpp /chronotest/src line 22 Semantic Error
Invalid arguments '
Candidates are:
__gnu_cxx::__normal_iterator<Bullet *,std::vector<Bullet,std::allocator<Bullet>>> erase(__gnu_cxx::__normal_iterator<Bullet *,std::vector<Bullet,std::allocator<Bullet>>>)
__gnu_cxx::__normal_iterator<Bullet *,std::vector<Bullet,std::allocator<Bullet>>> erase(__gnu_cxx::__normal_iterator<Bullet *,std::vector<Bullet,std::allocator<Bullet>>>, __gnu_cxx::__normal_iterator<Bullet *,std::vector<Bullet,std::allocator<Bullet>>>)
' Test2.cpp /Test2/src line 212 Semantic Error
Symbol 'ratio' could not be resolved chronotest.cpp /chronotest/src line 22 Semantic Error
Invalid arguments '
Candidates are:
#0 remove_if(#0, #0, #1)
' Test2.cpp /Test2/src line 212 Semantic Error
Symbol 'duration_cast' could not be resolved chronotest.cpp /chronotest/src line 28 Semantic Error
Method 'count' could not be resolved chronotest.cpp /chronotest/src line 28 Semantic Error
Method 'emplace_back' could not be resolved Test2.cpp /Test2/src line 191 Semantic Error
Symbol 'ratio' could not be resolved chronotest.cpp /chronotest/src line 19 Semantic Error
Symbol 'duration' could not be resolved chronotest.cpp /chronotest/src line 20 Semantic Error
Symbol 'duration' could not be resolved chronotest.cpp /chronotest/src line 21 Semantic Error
Function 'begin' could not be resolved Test2.cpp /Test2/src line 212 Semantic Error
Symbol 'ratio' could not be resolved chronotest.cpp /chronotest/src line 21 Semantic Error
[Редактировать]: Извините, что не содержит сведений об ошибке для оставшейся "to_string". Выход окна Eclipse "Проблема" имеет следующее:
Description Resource Path Location Type
'to_string' was not declared in this scope Test2.cpp /Test2/src line 170 C/C++ Problem
Function 'to_string' could not be resolved Test2.cpp /Test2/src line 170 Semantic Error
Function 'to_string' could not be resolved Test2.cpp /Test2/src line 170 Semantic Error
unused variable 'currentSlice' [-Wunused-variable] Test2.cpp /Test2/src line 125 C/C++ Problem
Function 'to_string' could not be resolved Test2.cpp /Test2/src line 170 Semantic Error
Invalid arguments '
Candidates are:
void setTitle(const sf::String &)
' Test2.cpp /Test2/src line 170 Semantic Error
Function 'to_string' could not be resolved Test2.cpp /Test2/src line 170 Semantic Error