Copy link to clipboard
Copied
I just downloaded the InDesign SDK for Plugin deveolpment. When I try to go with first plugin from tutorial WriteFishPrice, and open it in Visual Studio 2019, it gives me below error:
Error C1189 #error: "You need to update xlocnum hack header by copying over the header from your Visual Studio installation and applying the same changes as to the previous versions. Be careful, this header also changes between minor versions of Visual Studio. MSC_VER was: " VALUE_TO_STRING(_MSC_VER)
F:\01 InDesign Projects\AQPID\WriteFishPrice.vcxproj F:\InDesignSDK\source\precomp\msvc\xlocnum_hack.h
Please guide what should I do to resove this issue?
Copy link to clipboard
Copied
This error seems to be due to use of wrong version of VS. Which InDesign SDK are you using, did you check the version of VS needed for compiling the projects for this version of SDK?
-Manan
Copy link to clipboard
Copied
Hello,
This happened way back in June of 2021 with the minor update of VS2019 from 16.10.1 to 16.10.2 (no installation of a new Windows SDK or runtime, just an extremely minor patch to VS2019).
The solution is to patch the ID SDK file "xlocnum_hack_vs2019.h" as shown below (see "_MATCHING" for changes), as below.
...
_Str.push_back(_Elem{});
_Str += _Punct_fac.truename(); // construct "\0false\0true"
// Olivier 1-july-2021: after VS2019 update,
// function _Getloctxt() now requires 5 parameters
_Case_sensitive _MATCHING = _Case_sensitive::_Yes;
switch (_Getloctxt(_First, _Last, 2, _Str.c_str(), _MATCHING)) {
// end- Olivier
case 0:
...
Very best regards,
Olivier
Copy link to clipboard
Copied
Thanks Olivier, I have made changes in the file "" as below:
if (_Iosbase.flags() & ios_base::boolalpha) { // get false name or true name
const auto& _Punct_fac = _STD use_facet<numpunct<_Elem>>(_Iosbase.getloc());
basic_string<_Elem> _Str(static_cast<size_t>(1), _Elem{});
_Str += _Punct_fac.falsename();
_Str.push_back(_Elem{});
_Str += _Punct_fac.truename(); // construct "\0false\0true"
// Olivier 1-july-2021: after VS2019 update,
// function _Getloctxt() now requires 5 parameters
_Case_sensitive _MATCHING = _Case_sensitive::_Yes;
switch (_Getloctxt(_First, _Last, 2, _Str.c_str(), _MATCHING)) {
// end- Olivier
case 0:
_Val = false;
break;
case 1:
_Val = true;
break;
default:
_Val = false;
_State = ios_base::failbit;
break;
}
}
But still facing the error:
Severity Code Description Project File Line Suppression State
Error C1189 #error: "You need to update xlocnum hack header by copying over the header from your Visual Studio installation and applying the same changes as to the previous versions. Be careful, this header also changes between minor versions of Visual Studio. MSC_VER was: " VALUE_TO_STRING(_MSC_VER) WriteFishPrice F:\InDesignSDK\source\precomp\msvc\xlocnum_hack.h
More over, I noticed the else condition in file "xlocnum_hack.h":
#elif _MSC_VER >= 1920 && _MSC_VER < 1929 // VS 2019 version 16.0 - 16.10.1
#include "xlocnum_hack_vs2019.h"This shows the condition is for VS2019 version 16.0-16.1. But I am using the version VS2019 Version 16.11.8. Is this related to the problem?
Copy link to clipboard
Copied
Thanks Manan. In SDK Getting Started Page there is just mentioned
Visual C++ A component of Visual Studio 2019 (v16.7.0).
Copy link to clipboard
Copied
Try using 16.7.0 with the correct Windows SDK it should be fine. The last time i compiled one of my projects using this version for CC2022 it compiled and worked just fine.
-Manan
Copy link to clipboard
Copied
After all I got success to compile a sample plugin with Visual Studio 2019 with 16.11.8.
Along with Olivier's code, I had a one more modification in "xlocnum_hack.h" file:
//This line is
//#elif _MSC_VER >= 1920 && _MSC_VER < 1929 // VS 2019 version 16.0 - 16.10.1
//replaced with below line
#elif _MSC_VER >= 1920 && _MSC_VER < 1930 // VS 2019 version 16.0 - 16.11.8
Thanks Olivier for your kind help.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more