• GWEN and SFML 2.0 link errors
    6 replies, posted
hi, i have recently been playing around with GWEN and SFML 2.0 and both are working fine, except i can only have either SFML or GWEN statically linked. Both of them work fine together when dynamically linked and SFML works fine on its own statically linked, but i cant have SFML statically linked if i have GWEN statically linked. To sum that up, here is a list of sorts with the link type of both SFML and GWEN and the result: [TABLE="width: 500"] [TR] [TD][B]GWEN[/B][/TD] [TD][B]SFML[/B][/TD] [TD][B]Result[/B][/TD] [/TR] [TR] [TD]Static[/TD] [TD]Static[/TD] [TD]Linker Error[/TD] [/TR] [TR] [TD]Static[/TD] [TD]Dynamic[/TD] [TD]Works[/TD] [/TR] [TR] [TD]Dynamic[/TD] [TD]Static[/TD] [TD]Linker Error[/TD] [/TR] [TR] [TD]Dynamic[/TD] [TD]Dynamic[/TD] [TD]Works[/TD] [/TR] [/TABLE] So to sum up, i cant statically link SFML while im using GWEN otherwise i get linker errors. here is the list of linker errors im getting: [code] 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0View@sf@@QAE@XZ (public: __thiscall sf::View::View(void)) imported in function "public: __thiscall Gwen::Renderer::SFML2::SFML2(class sf::RenderTarget &)" (??0SFML2@Renderer@Gwen@@QAE@AAVRenderTarget@sf@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0Color@sf@@QAE@XZ (public: __thiscall sf::Color::Color(void)) imported in function "public: __thiscall Gwen::Renderer::SFML2::SFML2(class sf::RenderTarget &)" (??0SFML2@Renderer@Gwen@@QAE@AAVRenderTarget@sf@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?setView@RenderTarget@sf@@QAEXABVView@2@@Z (public: void __thiscall sf::RenderTarget::setView(class sf::View const &)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::Begin(void)" (?Begin@SFML2@Renderer@Gwen@@UAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?setViewport@View@sf@@QAEXABV?$Rect@M@2@@Z (public: void __thiscall sf::View::setViewport(class sf::Rect<float> const &)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::Begin(void)" (?Begin@SFML2@Renderer@Gwen@@UAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0View@sf@@QAE@ABV?$Rect@M@1@@Z (public: __thiscall sf::View::View(class sf::Rect<float> const &)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::Begin(void)" (?Begin@SFML2@Renderer@Gwen@@UAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?getView@RenderTarget@sf@@QBEABVView@2@XZ (public: class sf::View const & __thiscall sf::RenderTarget::getView(void)const ) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::Begin(void)" (?Begin@SFML2@Renderer@Gwen@@UAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z (public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)) imported in function "public: void __thiscall Gwen::Renderer::SFML2::Flush(void)" (?Flush@SFML2@Renderer@Gwen@@QAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.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: virtual void __thiscall Gwen::Renderer::SFML2::SetDrawColor(struct Gwen::Color)" (?SetDrawColor@SFML2@Renderer@Gwen@@UAEXUColor@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0Vertex@sf@@QAE@ABV?$Vector2@M@1@ABVColor@1@0@Z (public: __thiscall sf::Vertex::Vertex(class sf::Vector2<float> const &,class sf::Color const &,class sf::Vector2<float> const &)) imported in function "public: void __thiscall Gwen::Renderer::SFML2::AddVert(int,int,float,float)" (?AddVert@SFML2@Renderer@Gwen@@QAEXHHMM@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?getSize@Texture@sf@@QBE?AV?$Vector2@I@2@XZ (public: class sf::Vector2<unsigned int> __thiscall sf::Texture::getSize(void)const ) imported in function "public: void __thiscall Gwen::Renderer::SFML2::AddVert(int,int,float,float)" (?AddVert@SFML2@Renderer@Gwen@@QAEXHHMM@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??1String@sf@@QAE@XZ (public: __thiscall sf::String::~String(void)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0String@sf@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z (public: __thiscall sf::String::String(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?loadFromFile@Texture@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$Rect@H@2@@Z (public: bool __thiscall sf::Texture::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class sf::Rect<int> const &)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::LoadTexture(struct Gwen::Texture *)" (?LoadTexture@SFML2@Renderer@Gwen@@UAEXPAUTexture@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?setSmooth@Texture@sf@@QAEX_N@Z (public: void __thiscall sf::Texture::setSmooth(bool)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::LoadTexture(struct Gwen::Texture *)" (?LoadTexture@SFML2@Renderer@Gwen@@UAEXPAUTexture@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0Texture@sf@@QAE@XZ (public: __thiscall sf::Texture::Texture(void)) imported in function "public: virtual void __thiscall Gwen::Renderer::SFML2::LoadTexture(struct Gwen::Texture *)" (?LoadTexture@SFML2@Renderer@Gwen@@UAEXPAUTexture@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??1Texture@sf@@QAE@XZ (public: __thiscall sf::Texture::~Texture(void)) imported in function "public: void * __thiscall sf::Texture::`scalar deleting destructor'(unsigned int)" (??_GTexture@sf@@QAEPAXI@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??1Image@sf@@QAE@XZ (public: __thiscall sf::Image::~Image(void)) imported in function "public: void * __thiscall sf::Image::`scalar deleting destructor'(unsigned int)" (??_GImage@sf@@QAEPAXI@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?getPixel@Image@sf@@QBE?AVColor@2@II@Z (public: class sf::Color __thiscall sf::Image::getPixel(unsigned int,unsigned int)const ) imported in function "public: virtual struct Gwen::Color __thiscall Gwen::Renderer::SFML2::PixelColour(struct Gwen::Texture *,unsigned int,unsigned int,struct Gwen::Color const &)" (?PixelColour@SFML2@Renderer@Gwen@@UAE?AUColor@3@PAUTexture@3@IIABU43@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ??0Image@sf@@QAE@ABV01@@Z (public: __thiscall sf::Image::Image(class sf::Image const &)) imported in function "public: virtual struct Gwen::Color __thiscall Gwen::Renderer::SFML2::PixelColour(struct Gwen::Texture *,unsigned int,unsigned int,struct Gwen::Color const &)" (?PixelColour@SFML2@Renderer@Gwen@@UAE?AUColor@3@PAUTexture@3@IIABU43@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : warning LNK4217: locally defined symbol ?copyToImage@Texture@sf@@QBE?AVImage@2@XZ (public: class sf::Image __thiscall sf::Texture::copyToImage(void)const ) imported in function "public: virtual struct Gwen::Color __thiscall Gwen::Renderer::SFML2::PixelColour(struct Gwen::Texture *,unsigned int,unsigned int,struct Gwen::Color const &)" (?PixelColour@SFML2@Renderer@Gwen@@UAE?AUColor@3@PAUTexture@3@IIABU43@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::VertexArray::~VertexArray(void)" (__imp_??1VertexArray@sf@@UAE@XZ) referenced in function __unwindfunclet$??0SFML2@Renderer@Gwen@@QAE@AAVRenderTarget@sf@@@Z$0 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::VertexArray::setPrimitiveType(enum sf::PrimitiveType)" (__imp_?setPrimitiveType@VertexArray@sf@@QAEXW4PrimitiveType@2@@Z) referenced in function "public: __thiscall Gwen::Renderer::SFML2::SFML2(class sf::RenderTarget &)" (??0SFML2@Renderer@Gwen@@QAE@AAVRenderTarget@sf@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::RenderStates const sf::RenderStates::Default" (__imp_?Default@RenderStates@sf@@2V12@B) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VertexArray::VertexArray(void)" (__imp_??0VertexArray@sf@@QAE@XZ) referenced in function "public: __thiscall Gwen::Renderer::SFML2::SFML2(class sf::RenderTarget &)" (??0SFML2@Renderer@Gwen@@QAE@AAVRenderTarget@sf@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::VertexArray::clear(void)" (__imp_?clear@VertexArray@sf@@QAEXXZ) referenced in function "public: void __thiscall Gwen::Renderer::SFML2::Flush(void)" (?Flush@SFML2@Renderer@Gwen@@QAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall sf::VertexArray::getVertexCount(void)const " (__imp_?getVertexCount@VertexArray@sf@@QBEIXZ) referenced in function "public: void __thiscall Gwen::Renderer::SFML2::Flush(void)" (?Flush@SFML2@Renderer@Gwen@@QAEXXZ) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum sf::PrimitiveType __thiscall sf::VertexArray::getPrimitiveType(void)const " (__imp_?getPrimitiveType@VertexArray@sf@@QBE?AW4PrimitiveType@2@XZ) referenced in function "public: void __thiscall Gwen::Renderer::SFML2::EnsurePrimitiveType(enum sf::PrimitiveType)" (?EnsurePrimitiveType@SFML2@Renderer@Gwen@@QAEXW4PrimitiveType@sf@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::VertexArray::append(class sf::Vertex const &)" (__imp_?append@VertexArray@sf@@QAEXABVVertex@2@@Z) referenced in function "public: void __thiscall Gwen::Renderer::SFML2::AddVert(int,int,float,float)" (?AddVert@SFML2@Renderer@Gwen@@QAEXHHMM@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::LoadFont(struct Gwen::Font *)" (?LoadFont@SFML2@Renderer@Gwen@@UAEXPAUFont@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Font::Font(void)" (__imp_??0Font@sf@@QAE@XZ) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::LoadFont(struct Gwen::Font *)" (?LoadFont@SFML2@Renderer@Gwen@@UAEXPAUFont@3@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Font::~Font(void)" (__imp_??1Font@sf@@QAE@XZ) referenced in function "public: void * __thiscall sf::Font::`scalar deleting destructor'(unsigned int)" (??_GFont@sf@@QAEPAXI@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Text::~Text(void)" (__imp_??1Text@sf@@UAE@XZ) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Text::setColor(class sf::Color const &)" (__imp_?setColor@Text@sf@@QAEXABVColor@2@@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Text::setCharacterSize(unsigned int)" (__imp_?setCharacterSize@Text@sf@@QAEXI@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Transformable::move(float,float)" (__imp_?move@Transformable@sf@@QAEXMM@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Text::setFont(class sf::Font const &)" (__imp_?setFont@Text@sf@@QAEXABVFont@2@@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Text::setString(class sf::String const &)" (__imp_?setString@Text@sf@@QAEXABVString@2@@Z) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Text::Text(void)" (__imp_??0Text@sf@@QAE@XZ) referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::RenderText(struct Gwen::Font *,struct Gwen::Point,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?RenderText@SFML2@Renderer@Gwen@@UAEXPAUFont@3@UPoint@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Rect<float> __thiscall sf::Text::getLocalBounds(void)const " (__imp_?getLocalBounds@Text@sf@@QBE?AV?$Rect@M@2@XZ) referenced in function "public: virtual struct Gwen::Point __thiscall Gwen::Renderer::SFML2::MeasureText(struct Gwen::Font *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?MeasureText@SFML2@Renderer@Gwen@@UAE?AUPoint@3@PAUFont@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>GWEND-Renderer-SFML2d.lib(SFML2.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Transformable::setScale(float,float)" (__imp_?setScale@Transformable@sf@@QAEXMM@Z) referenced in function "public: virtual struct Gwen::Point __thiscall Gwen::Renderer::SFML2::MeasureText(struct Gwen::Font *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?MeasureText@SFML2@Renderer@Gwen@@UAE?AUPoint@3@PAUFont@3@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) [/code]
-bump-
-bump again-
Take GWEN out of the equation and you'll have SFML erroring when it's statically linked. Based on your table I'd say the errors are caused by SFML being statically linked.
no, i said when im using GWEN i cant statically link SFML. SFML on its own works perfectly fine either statically or dynamically linked
Looks like GWEN uses SFML for rendering itself. Are you sure you're working with the same version of SFML? (Also, shouldn't this be in the programmers subforum?)
what do you mean "the same version of SFML"? and it most likely does belong in programming i just realised - should i close this one and open up a new one? [editline]4th April 2013[/editline] im using SFML 2.0 with the GWEN SFML2 Renderer
Sorry, you need to Log In to post a reply to this thread.