How can I resolve this ERROR ? Linker 1120 unresolved externals

Hi Oli,
I´m new to IPlug - tried downloading it yesterday. I get the following error when building it:

Creating library C:\iPlug2-master\Examples\MyNewPlugin\build-win\vst3\Win32\Debug\int\MyNewPlugin.lib and object C:\iPlug2-master\Examples\MyNewPlugin\build-win\vst3\Win32\Debug\int\MyNewPlugin.exp
1>ITextEntryControl.obj : error LNK2001: unresolved external symbol “public: static class std::locale::id std::codecvt<char16_t,char,struct _Mbstatet>::id” (?id@?$codecvt@_SDU_Mbstatet@@@std@@2V0locale@2@A)
1>C:\iPlug2-master\Examples\MyNewPlugin\build-win\vst3\Win32\Debug\MyNewPlugin.vst3 : fatal error LNK1120: 1 unresolved externals
1>Done building project “MyNewPlugin-vst3.vcxproj” – FAILED.

I tried going back a couple of versions (16 days ago - before ITextEntryControl changes ).
Tried the commits before Apr 9, 2020 - same Error.

I use the latest version of windows 10 and the latest version of visual studio 2019.
I installed the dependecies according to the readme.md …

what am i doing wrong :O?

1 Like

@vasyan also had this error.

Does it happen if you build the x64 version?

I am going to modify the ITextEntryControl not to use std::codecvt, which I hope will fix the issue

unfortunately yes - it also happens if i set it to x64.

It is necessary to solve this problem.

This seems like a long established MSVC bug

https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error?forum=vcgeneral

but I don’t know why it works on my machine.

What Windows SDK do you have installed? You can check in the “property pages”

I have 10.0.18362.0

I have 10.0.17763.0 :zipper_mouth_face:

could you try upgrading? see if it makes a difference

I installed the SDK version 10.0.18362.0, however this error did not disappear. Apparently the matter is different.

Please try this fix to see if it helps: stl - Visual Studio C++ 2015 std::codecvt with char16_t or char32_t - Stack Overflow

And make sure to use the latest Visual Studio version 16.5.4.

This is not an option to arrange a race to upgrade Visual Studio. You need to write code so that it works on not very recent versions. Or at least make the code work both there and there. Nothing personal, just good manners in programming. :grinning:

In general i can agree. But since this is somewhat a bug in VStudio it is OK to either live with it and use the workaround from the link above. Or update VStudio to a recent version, or in this case at least v16.2 which is already pretty old.

Due to this and since Oli nor I do not get this error in our dev environments it should not be a matter of the iPlug2 library to make it work in all cases. Otherwise I would actually opt for iPlug2 being useable in my old VC++ 6.0 release (running in a Win2000 virtual machine) which is so damn fast.

1 Like

I have tried on 3 different Windows, some with old VS2019 / SDK and they all work fine with iPlug2 tip.

@einfachfelix and @vasyan please could you try some of the solutions in the link @asedev posted?

Do all examples/formats fail to build with the same error?

ok this is my unpleasant reply:
I tried to do what the people wrote on stackoverflow, but i´m a noob in c++ so didn´t understand the first solution.(i really just started to learn it) So I just copied:
#include < locale >

#if (!_DLL) && (_MSC_VER >= 1900 /* VS 2015*/) && (_MSC_VER <= 1911 /* VS 2017 */)
std::locale::id std::codecvt<char16_t, char, _Mbstatet>::id;
#endif

and the plugin builds now (yay) and i can run it in a daw but i get the following error:

Severity Code Description Project File Line Suppression State
Error MSB3073 The command “CALL “C:\iPlug2-master\Examples\MyNewPlugin\scripts\postbuild-win.bat” “.vst3” “MyNewPlugin” “Win32” “1” “C:\iPlug2-master\Examples\MyNewPlugin\build-win\vst3\Win32\Debug\MyNewPlugin.vst3” “C:\Program Files (x86)\VstPlugins” “C:\Program Files\VstPlugins” “C:\Program Files (x86)\Common Files\VST3” “C:\Program Files\Common Files\VST3” “C:\Program Files (x86)\Common Files\Avid\Audio\Plug-Ins” “C:\Program Files\Common Files\Avid\Audio\Plug-Ins” “C:\iPlug2-master\Examples\MyNewPlugin\build-win” “C:\iPlug2-master\Examples\MyNewPlugin\projects…\Dependencies\IPlug\VST3_SDK\doc\artwork\VST_Logo_Steinberg.ico” “C:\iPlug2-master\Examples\MyNewPlugin\projects…\Dependencies\IPlug\AAX_SDK\Utilities\PlugIn.ico” “C:\iPlug2-master\Examples\MyNewPlugin\projects…\Scripts\create_bundle.bat”
:VCEnd” exited with code 4. MyNewPlugin-vst3 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 138

Thanks for trying this

The error you are seeing now is coming from the post-build script - it is not related to the same thing. This is good news. It probably means there is a permissions problem copying the plug-in binary to your VST3 or VST2 folders.

1 Like

yes you were right i just have to run Visual Studio as Admin

OK - I’ve added what I think is a correct workaround (a little like the one above, but a little more safe for different versions - checking first that we appear to be in VS and then trying to get the right versions as I am on a later version of VS with the bug but not included in the versions above).

This means:

A - you don’t need to make your own workarounds
B - if you have they might conflict and you should remove them from your code