Unresolved External Symbol in CallbackManager::bindCallbackEx

Started by Charsmud, 02 September 2015, 05:44:32

Charsmud

I recently updated my computer to windows 10, and have been getting the following error:

Severity Code Description Project File Line
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __thiscall tgui::CallbackManager::bindCallbackEx(class std::function<void __cdecl(struct tgui::Callback const &)>,unsigned int)" (__imp_?bindCallbackEx@CallbackManager@tgui@@QAEXV?$function@$$A6AXABUCallback@tgui@@@Z@std@@I@Z) referenced in function "public: virtual void __thiscall GuiOptions::loadWidgets(void)" (?loadWidgets@GuiOptions@@UAEXXZ) Byte E:\GameDev\C++\Byte\Byte\GuiOptions.obj 1


I've gotten unresolved external symbol errors before, but I cannot seem to figure this out.  Any help? 

texus

This is the only linking error you get, right? No other ones? That's weird so I'm going to need a bit more information.

Did anything else change other than the update to windows 10? A different compiler, different project, different project settings, ...?

Did you download the tgui library or did you build it yourself? What version are you using exactly?
Could you send me the tgui dll so that I can check if it contains the function?

Could you also show me the line in your code where this happens (some bindCallbackEx function call inside your GuiOptions::loadWidgets function) and the declaration of the function that you are trying to bind?

Charsmud

I am using Visual Studio 2015.  I don't remember if I built or downloaded the library, but I've attached the dll to the post (https://www.dropbox.com/sh/5wg3bkmhtskx2av/AAD6rcFwKUJ4I9Bem-UdaHxQa?dl=0).  Here's the code block the line is in:

buttonExit->bindCallback(tgui::Button::LeftMouseClicked);
buttonExit->setCallbackId(1);
buttonApply->bindCallback(tgui::Button::LeftMouseClicked);
buttonApply->setCallbackId(3);
cbResolution->bindCallbackEx(resolutionCallback, tgui::ComboBox::ItemSelected);


and the associated code:

tgui::ComboBox::Ptr cbResolution(mGui);
cbResolution->load("Media/Widgets/Black.conf");
cbResolution->setSize(260, 30);
cbResolution->setPosition(360, 250);
cbResolution->addItem("800x600");
cbResolution->addItem("1024x768");
cbResolution->addItem("1280x800");
cbResolution->addItem("1280x1024");
cbResolution->addItem("1366x768");
cbResolution->addItem("1440x900");
cbResolution->addItem("1600x900");
cbResolution->addItem("1680x1050");
cbResolution->addItem("1920x1080");

texus

You should try to recompile tgui with VS2015.

There is something strange with the dll, the bindCallbackEx uses std::tr1::function instead of std::function while your program tries to load the one with std::function which I can see exist in my VS2013 version. I don't have the VS2015 compiler here so I can't compare it with that.

Edit: I just installed VS2015. If you recompile it and you have the same error then you should send me your SFML libraries, then I can try to build it here with the same libraries and see if I can reproduce it.