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

Author Topic: SFML2 Static Lib Linker Error  (Read 3455 times)

0 Members and 1 Guest are viewing this topic.

JCSopko

  • Newbie
  • *
  • Posts: 19
    • View Profile
SFML2 Static Lib Linker Error
« on: November 08, 2010, 01:06:46 am »
I saw there were a few others of these but the proposed solutions didn't work.

I've tried downloading, compiling SFML2 with cmake, and compiling SFML2 three times with no results. I get the libraries but end up getting these linker errors when using the static debug libraries:

1>Game.obj : warning LNK4217: locally defined symbol ??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@1@@Z (public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)) imported in function "public: __thiscall Game::Game(void)" (??0Game@@QAE@XZ)
1>Game.obj : warning LNK4217: locally defined symbol ??0VideoMode@sf@@QAE@III@Z (public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)) imported in function "public: __thiscall Game::Game(void)" (??0Game@@QAE@XZ)
1>Game.obj : warning LNK4217: locally defined symbol ??1RenderWindow@sf@@UAE@XZ (public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)) imported in function "public: virtual void * __thiscall sf::RenderWindow::`scalar deleting destructor'(unsigned int)" (??_GRenderWindow@sf@@UAEPAXI@Z)
1>Game.obj : warning LNK4217: locally defined symbol ?Display@Window@sf@@QAEXXZ (public: void __thiscall sf::Window::Display(void)) imported in function "public: void __thiscall Game::draw(void)" (?draw@Game@@QAEXXZ)
1>Game.obj : warning LNK4217: locally defined symbol ?Draw@RenderTarget@sf@@QAEXABVDrawable@2@@Z (public: void __thiscall sf::RenderTarget::Draw(class sf::Drawable const &)) imported in function "public: void __thiscall Game::draw(void)" (?draw@Game@@QAEXXZ)
1>Game.obj : warning LNK4217: locally defined symbol ?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z (public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)) imported in function "public: void __thiscall Game::draw(void)" (?draw@Game@@QAEXXZ)
1>Game.obj : warning LNK4217: locally defined symbol ??0Color@sf@@QAE@EEEE@Z (public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)) imported in function "public: void __thiscall Game::draw(void)" (?draw@Game@@QAEXXZ)
1>GameObject.obj : warning LNK4049: locally defined symbol ??0Color@sf@@QAE@EEEE@Z (public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)) imported
1>GameObject.obj : warning LNK4217: locally defined symbol ??1Image@sf@@QAE@XZ (public: __thiscall sf::Image::~Image(void)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>GameObject.obj : warning LNK4217: locally defined symbol ?SetColor@Drawable@sf@@QAEXABVColor@2@@Z (public: void __thiscall sf::Drawable::SetColor(class sf::Color const &)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>GameObject.obj : warning LNK4217: locally defined symbol ?SetPosition@Drawable@sf@@QAEXMM@Z (public: void __thiscall sf::Drawable::SetPosition(float,float)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>GameObject.obj : warning LNK4217: locally defined symbol ?SetOrigin@Drawable@sf@@QAEXMM@Z (public: void __thiscall sf::Drawable::SetOrigin(float,float)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>TestGameObject.obj : warning LNK4217: locally defined symbol ?SetOrigin@Drawable@sf@@QAEXMM@Z (public: void __thiscall sf::Drawable::SetOrigin(float,float)) imported in function "public: __thiscall TestGameObject::TestGameObject(void)" (??0TestGameObject@@QAE@XZ)
1>GameObject.obj : warning LNK4217: locally defined symbol ?Create@Image@sf@@QAE_NIIABVColor@2@@Z (public: bool __thiscall sf::Image::Create(unsigned int,unsigned int,class sf::Color const &)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>GameObject.obj : warning LNK4217: locally defined symbol ??0Image@sf@@QAE@XZ (public: __thiscall sf::Image::Image(void)) imported in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>TestGameObject.obj : warning LNK4217: locally defined symbol ??0Image@sf@@QAE@XZ (public: __thiscall sf::Image::Image(void)) imported in function __ehhandler$??0TestGameObject@@QAE@XZ
1>GameObject.obj : warning LNK4217: locally defined symbol ?SetRotation@Drawable@sf@@QAEXM@Z (public: void __thiscall sf::Drawable::SetRotation(float)) imported in function "public: virtual void __thiscall GameObject::update(void)" (?update@GameObject@@UAEXXZ)
1>TestGameObject.obj : warning LNK4217: locally defined symbol ?LoadFromFile@Image@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: bool __thiscall sf::Image::LoadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "public: __thiscall TestGameObject::TestGameObject(void)" (??0TestGameObject@@QAE@XZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Sprite::~Sprite(void)" (__imp_??1Sprite@sf@@UAE@XZ) referenced in function "public: void __thiscall Game::loadLevel(char *)" (?loadLevel@Game@@QAEXPAD@Z)
1>GameObject.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Sprite::~Sprite(void)" (__imp_??1Sprite@sf@@UAE@XZ)
1>Game.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sprite::Sprite(void)" (__imp_??0Sprite@sf@@QAE@XZ) referenced in function "public: void __thiscall Game::loadLevel(char *)" (?loadLevel@Game@@QAEXPAD@Z)
1>GameObject.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sprite::Sprite(void)" (__imp_??0Sprite@sf@@QAE@XZ)
1>GameObject.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Sprite::SetImage(class sf::Image const &,bool)" (__imp_?SetImage@Sprite@sf@@QAEXABVImage@2@_N@Z) referenced in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>TestGameObject.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Sprite::SetImage(class sf::Image const &,bool)" (__imp_?SetImage@Sprite@sf@@QAEXABVImage@2@_N@Z)
1>GameObject.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Sprite & __thiscall sf::Sprite::operator=(class sf::Sprite const &)" (__imp_??4Sprite@sf@@QAEAAV01@ABV01@@Z) referenced in function "public: __thiscall GameObject::GameObject(struct b2Vec2,struct b2Vec2)" (??0GameObject@@QAE@Ub2Vec2@@0@Z)
1>C:\Users\Joe\Desktop\GameObjectClass\Windows\build\Static Debug\Game1.exe : fatal error LNK1120: 4 unresolved externals
1>
1>Build FAILED.

Any suggestions?


P.S. Code currently works with Dynamic Debug so it's not the code.

Thanks!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML2 Static Lib Linker Error
« Reply #1 on: November 08, 2010, 07:11:45 am »
Currently helping someone else with the same problem in this thread:
http://sfml-dev.org/forum/viewtopic.php?t=3527
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML2 Static Lib Linker Error
« Reply #2 on: November 08, 2010, 07:46:04 am »
You must define SFML_STATIC.
Laurent Gomila - SFML developer

JCSopko

  • Newbie
  • *
  • Posts: 19
    • View Profile
SFML2 Static Lib Linker Error
« Reply #3 on: November 08, 2010, 06:23:08 pm »
Laurent I have no idea how you help so many people, and develop an amazing framework, and have time for anything else in your life.

Thanks =D

Question to anyone who knows, I usually do defines in my project properties in visual studio (which works) but i'm just curious if I wanted to put it in my actual code what would be the actual syntax?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML2 Static Lib Linker Error
« Reply #4 on: November 08, 2010, 07:09:52 pm »
Quote from: "JCSopko"
Laurent I have no idea how you help so many people, and develop an amazing framework, and have time for anything else in your life.

Thanks =D

Question to anyone who knows, I usually do defines in my project properties in visual studio (which works) but i'm just curious if I wanted to put it in my actual code what would be the actual syntax?


Code: [Select]
#define SFML_STATIC

But I recommend that you just simply use the project properties for this.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

 

anything