Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can't use animation  (Read 2363 times)

0 Members and 1 Guest are viewing this topic.

MahanGM

  • Newbie
  • *
  • Posts: 18
    • Yahoo Instant Messenger - mahan_pro2000
    • View Profile
    • http://www.df-gamez.com
Can't use animation
« on: February 28, 2011, 09:12:21 pm »
Hi. I'm using frame_anim_animated class too use animation but it just give me some error that I cant recognize them.

http://www.sfml-dev.org/wiki/en/sources/frame_anim_animated

Code: [Select]
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sftools::Animated::Play(void)" (?Play@Animated@sftools@@QAEXXZ) referenced in function "int __cdecl loadResources(void)" (?loadResources@@YAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sftools::Animated::SetAnim(class sftools::Anim const &,bool)" (?SetAnim@Animated@sftools@@QAEXABVAnim@2@_N@Z) referenced in function "int __cdecl loadResources(void)" (?loadResources@@YAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sftools::Frame::Frame(class sf::Image const &,class sf::Rect<int> const &,class sf::Color const &)" (??0Frame@sftools@@QAE@ABVImage@sf@@ABV?$Rect@H@3@ABVColor@3@@Z) referenced in function "int __cdecl loadResources(void)" (?loadResources@@YAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sftools::Frame::Frame(class sftools::Frame const &)" (??0Frame@sftools@@QAE@ABV01@@Z) referenced in function "protected: void __thiscall std::vector<class sftools::Frame,class std::allocator<class sftools::Frame> >::_Insert_n(class std::_Vector_iterator<class sftools::Frame,class std::allocator<class sftools::Frame> >,unsigned int,class sftools::Frame const &)" (?_Insert_n@?$vector@VFrame@sftools@@V?$allocator@VFrame@sftools@@@std@@@std@@IAEXV?$_Vector_iterator@VFrame@sftools@@V?$allocator@VFrame@sftools@@@std@@@2@IABVFrame@sftools@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sftools::Animated::Animated(float,bool,bool)" (??0Animated@sftools@@QAE@M_N0@Z) referenced in function "void __cdecl `dynamic initializer for 'Whizzle''(void)" (??__EWhizzle@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sftools::Animated::~Animated(void)" (??1Animated@sftools@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'Whizzle''(void)" (??__FWhizzle@@YAXXZ)
1>C:\Whizzle\Debug\Whizzle.exe : fatal error LNK1120: 6 unresolved externals


I put the classes next of my project.
This is a land of broken hearts, where bullets shatter dreams (50 Cent)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Can't use animation
« Reply #1 on: February 28, 2011, 11:18:40 pm »
did you also add the .cpp files to your project (you need to compile&link them) ?
SFML / OS X developer

MahanGM

  • Newbie
  • *
  • Posts: 18
    • Yahoo Instant Messenger - mahan_pro2000
    • View Profile
    • http://www.df-gamez.com
Can't use animation
« Reply #2 on: March 01, 2011, 05:42:25 pm »
Oh ! I forget to do this. I should compile cpp files and link them like libraries.

I'm really sorry, Excuse Me !  :roll:

EDIT: How can I compile files to libraries ? and should I compile cpp files our headers !?  :D
This is a land of broken hearts, where bullets shatter dreams (50 Cent)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Can't use animation
« Reply #3 on: March 01, 2011, 07:54:50 pm »
No prob ;-)

Quote
How can I compile files to libraries ?
It mainly depends on your compiler/OS/ide/whatever you use. Ask google. (Maybe something like 'gcc -shared -o mylib.so -c myfile.cpp' if you're using gcc on linux.)

Quote
and should I compile cpp files our headers !?
Rule number one  of compile in C-like language : Never ever compiler header files.
SFML / OS X developer

MahanGM

  • Newbie
  • *
  • Posts: 18
    • Yahoo Instant Messenger - mahan_pro2000
    • View Profile
    • http://www.df-gamez.com
Can't use animation
« Reply #4 on: March 01, 2011, 08:58:33 pm »
WoW thanks. Of course I remembered that I should compile cpp files but I wasn't sure. tnx again.
This is a land of broken hearts, where bullets shatter dreams (50 Cent)

 

anything