0 / 0 / 0
Регистрация: 26.06.2015
Сообщений: 15
|
||||||
1 | ||||||
Марио на SFML. Ошибка "'AnimationManager' is undefined"01.07.2015, 20:53. Показов 1332. Ответов 6
Метки нет (Все метки)
Всем привет! Пишу игру платформер на SFML C++.Возникла ошибка 'AnimationManager' is undefined. Здесь тексты cpp и hpp:
0
|
01.07.2015, 20:53 | |
Ответы с готовыми решениями:
6
Ошибка undefined reference при запуске программы с sfml Ошибка "Undefined reference" при компиляции примера на SFML в Dev-cpp как сделать марио касался в лаки болок из него выпали грибы которые двигались за марио Sfml и undefined |
2782 / 1935 / 570
Регистрация: 05.06.2014
Сообщений: 5,600
|
|
01.07.2015, 20:59 | 2 |
AnimationManager объявлен в anim.hpp, в main включен только SFML/Graphics.hpp. Все используемые в cpp файле классы должны быть доступны через упомянутые в начале include.
0
|
0 / 0 / 0
Регистрация: 26.06.2015
Сообщений: 15
|
||||||
01.07.2015, 21:33 [ТС] | 3 | |||||
Включил include anim.hpp и после появилась ошибка в строке :anim.create("duck",q,0,436,80,20,1,0.005); не хватало 8 элемента добавил 40 :anim.create("duck",q,0,436,80,20,1,0.005,40); следом следующая в классе map:
error C2512: 'Animation::Animation' : no appropriate default constructor available 1>------ Build started: Project: 3, Configuration: Debug Win32 ------ 1> 3.cpp 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\anim.hpp(37): warning C4244: 'initializing' : conversion from 'float' to 'int', possible loss of data 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\anim.hpp(58): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\anim.hpp(58): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(14): warning C4305: 'argument' : truncation from 'double' to 'float' 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(15): warning C4305: 'argument' : truncation from 'double' to 'float' 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(16): warning C4305: 'argument' : truncation from 'double' to 'float' 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(17): warning C4305: 'argument' : truncation from 'double' to 'float' 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(18): warning C4305: 'argument' : truncation from 'double' to 'float' 1>c:\users\valentin\documents\visual studio 2010\projects\3\3\3.cpp(24): warning C4244: 'initializing' : conversion from 'sf::Int64' to 'float', possible loss of data 1>c:\program files\microsoft visual studio 10.0\vc\include\map(215): error C2512: 'Animation::Animation' : no appropriate default constructor available 1> c:\program files\microsoft visual studio 10.0\vc\include\map(210) : while compiling class template member function 'Animation &std::map<_Kty,_Ty>::operator [](const sf::String &)' 1> with 1> [ 1> _Kty=sf::String, 1> _Ty=Animation 1> ] 1> c:\users\valentin\documents\visual studio 2010\projects\3\3\anim.hpp(47) : see reference to class template instantiation 'std::map<_Kty,_Ty>' being compiled 1> with 1> [ 1> _Kty=sf::String, 1> _Ty=Animation 1> ] ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== тексты здесь cpp:
0
|
67 / 67 / 72
Регистрация: 10.04.2015
Сообщений: 281
|
|
01.07.2015, 21:41 | 4 |
Теоретически нету дефолтного конструктора.
Может быть, проблема здесь: std::map<String, Animation> animList; А может и нет... Недавно было такая тема, надо поискать.
0
|
0 / 0 / 0
Регистрация: 26.06.2015
Сообщений: 15
|
||||||
01.07.2015, 22:10 [ТС] | 5 | |||||
Включил include anim.hpp и после появилась ошибка в строке :anim.create("duck",q,0,436,80,20,1,0.005); не хватало 8 элемента добавил 40 :anim.create("duck",q,0,436,80,20,1,0.005,40); следом следующая в классе map:
cpp:
0
|
0 / 0 / 0
Регистрация: 26.06.2015
Сообщений: 15
|
|||||||||||
01.07.2015, 23:01 [ТС] | 6 | ||||||||||
Включил include anim.hpp и после появилась ошибка в строке :anim.create("duck",q,0,436,80,20,1,0.005); не хватало 8 элемента добавил 40 :anim.create("duck",q,0,436,80,20,1,0.005,40); следом следующая в классе map:
error C2512: 'Animation::Animation' : no appropriate default constructor available cpp:
0
|
941 / 869 / 355
Регистрация: 10.10.2012
Сообщений: 2,706
|
|
02.07.2015, 00:09 | 7 |
0
|
02.07.2015, 00:09 | |
02.07.2015, 00:09 | |
Помогаю со студенческими работами здесь
7
Undefined reference to в Code::Blocks [SFML] Ошибка: CMake Error at deps/SFML/src/SFML/Window/CMakeLists.txt:106 (message): Xrandr library not found Ошибка C2661 с RectangleShape в Марио на C++ Игра "Марио" - ошибка после компиляции ошибка sfml SFML Ошибка с if else Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |