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

Author Topic: [Solved] Project compiles but wont link.  (Read 1303 times)

0 Members and 1 Guest are viewing this topic.

stalker2106

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
[Solved] Project compiles but wont link.
« on: August 03, 2017, 02:11:35 pm »
Hello, i've been developping a game engine based on SFML for quite a while now, and after some refactoring for the project to compile under MinGW, it wont compile anymore on visual studio. Diffs on git show me neither the project file nor the built bins are modified since. thought, checkout of the old revision compiles, and HEAD doesnt.

I added all sfml-*-d.lib to linker options in VS2013(x86_win32). I also added the sfml-main-d.lib (because i generate a .dll)
I built those binaries with CMAKE and VS2013(x86_win32)

The linker gives the following error:
Quote
unresolved external symbol "private: virtual bool __thiscall sf::RenderWindow::activate(bool)" (?activate@RenderWindow@sf@@EAE_N_N@Z)

everything links but activate. Where should I look ? i've been struggling recompiling sfml a few times and messing with libs input in visual studio.. why ONLY this method wouldn't link ? I don't even call it in my code.

EDIT: repo for curious/testing https://bitbucket.org/stalker2106/stbxengine/

Thanks for your help.
Maxime.
« Last Edit: August 03, 2017, 11:49:53 pm by stalker2106 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Project compiles but wont link.
« Reply #1 on: August 03, 2017, 03:43:06 pm »
That function was added at a later point in timr, so I assume you've updated the SFML header files to a newer version but forgot to update the .lib and/or .dll files.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

stalker2106

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Project compiles but wont link.
« Reply #2 on: August 03, 2017, 07:20:45 pm »
Hi eXpl0it3r, thanks for your time.

I just pulled the latest commit of SFML repo; compiled them with cmake for vs2013 x86_i386
Visual studio still hangs with the same linker error.

Are you sure about includes ? because it looks like the sengine.dll (my lib) uses that method which is nowhere to find inside lsfml linked binaries... at least that's how I interpret the linker error.

(reminder; whole error) :
Quote
Error   25   error LNK2001: unresolved external symbol "private: virtual bool __thiscall sf::RenderWindow::activate(bool)" (?activate@RenderWindow@sf@@EAE_N_N@Z)   W:\Projets\stbxengine\vs\Test\libsengine.dll(Engine.obj)   Test

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Project compiles but wont link.
« Reply #3 on: August 03, 2017, 08:06:09 pm »
Actually it's the other way around, SFML is updated but your headers or rather some of them have not been updated.

The RenderTarget.hpp file in your repository is not that one that matches SFML 2.4.2 and that private activate() function has been removed, thus leading to issues.

At best you just delete the SFML directory in your repo and replace it completely with the new one. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

stalker2106

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Project compiles but wont link.
« Reply #4 on: August 03, 2017, 09:08:05 pm »
Oh. A coworker did commit an unexpected "SFML" include folder in my include folder... I did not check that out haha... my mistake, sorry for bothering!

Regards,
Max
« Last Edit: August 03, 2017, 11:51:08 pm by stalker2106 »

 

anything