🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Gets strange unresolved external symbol...

Started by
4 comments, last by SyncViews 4 years, 2 months ago

Hi!

After upgrading to visual studio 2017 (c++) i cannot compile and get this (see below)

Im not able to solve it. It seems this is not my code but rather some library that causes this?

Any help you can offer?

1>msvcprtd.lib(locale0_implib.obj) : error LNK2019: unresolved external symbol __imp___free_dbg referenced in function "public: static void __cdecl std::_Fac_node::operator delete(void *)" (??3_Fac_node@std@@SAXPAX@Z)

1>msvcprtd.lib(locale0_implib.obj) : error LNK2019: unresolved external symbol __imp___malloc_dbg referenced in function "public: static void * __cdecl std::_Fac_node::operator new(unsigned int)" (??2_Fac_node@std@@SAPAXI@Z)

Advertisement

Looks like you messed up some references. __imp___free_dbg seems like the debug version of the free function and it's allocation counterpart that were used in the new/ delete operators. Check if you are using debug versions of headers while being in release and if there are references added/ missing. Maybe you need to update the SDK and CRT, I don't know if your installation went well at all

Thanks for your answer. Do you know where to start looking? Is this an solution settings error? I have projects that i can compile in the new environment and I have copied all solution settings from those to the project that refuses to compile, but still the same…

Check the dependencies of your broken project, maybe there is something referring to an older SDK version or location for linker assemblies. VS sometimes hides strange stuff behind the

(additional dependencies)

line you sometimes see in the project settings. If that doesn't help at all, you need to walk through your code to see if there are header files included that are outdated or you have a define made that turns something on/off in some SDK header you don't know about.

Anyways, doing a clean setup of the project and add your source files one after the other seems to be best solution here. If it still happens then, your code is causes the issue.

To be honest, I wasted so much time maintaining VisualStudio projects, project settings and odd compiler errors after all, that I now throw every project and solution file away every day and use my tool to auto generate a new one if I want to continue work on that project

If you didn't probably best to make sure you recompile any library dependencies with the same toolchain and settings, except possibly for some libraries known to be designed for mismatches (will always be a DLL since static libs themselves are version dependent, generally C API or possibly COM, probably Microsoft's own in practice), nothing special about Visual Studio here, C/C++ object file and static libraries are version/toolchain and frequently setting specific.

locale0_implib.obj looks to be from a C++ STL source file, _malloc_dbg, _free_dbg are declared in Windows 10 SDK headers for me (on MSVC 2019, even if using say the 8.1 SDK for Windows.h etc.) as part of the Universal CRT headers. So my guess is some obj/lib file in your dependencies is on the wrong version/settings.

This topic is closed to new replies.

Advertisement