2024-02-20 08:17 PM - last edited on 2024-09-17 11:26 AM by Doreena Deng
I have errors at build time, many of which are tied back to unordered_map.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(38,23): error C2061: syntax error: identifier '_Node_handle'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(63): message : see reference to class template instantiation 'std::_Umap_traits<_Kty,_Ty,_Tr,_Alloc,_Mfl>' being compiled [G:\dev\v27\JHP_Audit\out\build\x64-Release\JHP_Audit.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(39,41): error C2059: syntax error: '>'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(67,35): error C2143: syntax error: missing ',' before '<'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(405): message : see reference to class template instantiation 'std::unordered_map<_Kty,_Ty,_Hasher,_Keyeq,_Alloc>' being compiled [G:\dev\v27\JHP_Audit\out\build\x64-Release\JHP_Audit.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(67,60): error C2065: '_Uhash_compare': undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(67,36): error C2974: 'std::_Umap_traits': invalid template argument for '_Tr', type expected
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\unordered_map(30): message : see declaration of 'std::_Umap_traits' [G:\dev\v27\JHP_Audit\out\build\x64-Release\JHP_Audit.vcxproj]
Here are results of a grep on my project files for unordered_map.
settings.json >>> the one instance is associated with "files.associations": {}
CL.read.1.tlog >>> is a log file that ties ..\TOOLS\MSVC\14.29.30133\INCLUDE\UNORDERED_MAP back to ACADinc.h
unordered_map.txt >>> is a file I saved of the text in the output window after the build
ACAPinc.h >>> appears to be the culpret. The two instances in this file are the #include and the usage as an argument in ACAPI_AutoText_GetNoteAutotexts(). This copy of ACAPinc.h is dated 8/14/2023 3:14:52 PM and appears to be the latest.
I have read about a different bug with unordered_map and a fix HERE that implies using VS17.1
And another different bug with a workaround HERE that implies removing options from the compiler.
I am using VS2019, Tool set 142, Version 16.11.30
Would an upgrade to VS17 address my issue too?
I sort of expected that somethign like this was being handled by
#include "ACAPI_MigrationHeader.hpp"
Anyone else ever experience this?
Thanks to all -
Chris
2024-02-27 12:08 AM
*please note edits and revisions to the previous post that I have made off and on throughout this afternoon.
It's the final version, I promise... 🙂
2024-02-27 09:38 AM
Are your APICommon.c/h coming from your archived Add-On version? I assume you got them from some example projects.
This file changed quite a bit between API versions, so it might be worth considering updating it by copying a version from the example projects of the 27 API DevKit. Or if you don't need any function from the APICommon.c/h you can also get rid of it, or only extract the function you need. These 2 file are not necessary for an Add-On.
If you press F12 in Visual Studio on ACAPinc.h, you get the AC27 version right?
Other then those suggestions/questions I'm running out of ideas.
The last resort would be for you to provide us a skeleton version of your Add-On. So remove all code from your Add-On that is proprietary to your project but leave the typical Add-On stuff in and maybe just one dummy menu item. See if you get the same errors, and if you still do, we could try and debug the issue on our machines.
Best,
Bernd
2024-02-27 04:19 PM - edited 2024-02-27 05:37 PM
Hey Bernd,
Thanks for the continued attention to this little glitch I am experiencing.
Reminder: The only difference with this and one other project is source code from multiple subdirectories in ..\Src\ has been moved into ..\Src\ for the sake of easy CMake configuration. And all of the '..\' from #include have been removed.
"Are your APICommon.c/h coming from your archived Add-On version?"
I have copied APICommon.c/h and APIinc.h from ..\API Development Kit 27.3001\Examples\ projects.
In my project, they are placed in the ..\Src\ folder, similar to projects in the ..\API Development Kit 27.3001\Examples\ folder.
The ones I am using are time stamped 8/14/2023 4:00PM.
"If you press F12 in Visual Studio on ACAPinc.h, you get the AC27 version right?"
Yes. I get the one from the ..\Src\ folder in my project.
"The last resort would be for you to provide us a skeleton version of your Add-On. So remove all code from your Add-On that is proprietary to your project but leave the typical Add-On stuff in and maybe just one dummy menu item. See if you get the same errors, and if you still do, we could try and debug the issue on our machines."
I started doing that yesterday afternoon and will continue with that exercise today. I may also start a new Add-On that does not copy anything from previous projects. I have one in mind that has been on the drawing boards for a bit. As a last resort, I can bundle up a slimmed down version of what I am struggling with over here. I appreciate the offer of collaboration.
Update: I have started a new Add-On and have achieved a successful build. The function of the Add-On is to provide a menu choice that, when selected, confirms that selection with a dialog.
GSErrCode __ACENV_CALL MenuCommandHandler(const API_MenuParams* params)
{
return ACAPI_CallUndoableCommand("JHP_ProjectType Menu Command", [&]() -> GSErrCode {
switch (params->menuItemRef.menuResID)
{
case JHP_PROJECTTYPE_MENU_STRINGSID:
switch (params->menuItemRef.itemIndex)
{
case 1:
JHP_ProjectType();
break;
}
break;
}
return NoError;
});
}
void JHP_ProjectType() {
ACAPI_WriteReport("JHP_ProjectType", true);
}
All the best,
Chris
2024-02-28 10:19 PM
Chris,
Looking at the error list in the pdf file, I noticed that compiler can't find definitions of some types like UInt16, USize and so on. They are all defined in Definitions.hpp (usually in C:\Program Files\Graphisoft\API Development Kit 27.3001\Support\Modules\GSRoot) So, check if that header file is included in your source file and the compiler can find it. Also, try to use the namespace w/those types (GS::UInt16, GS::USize) and see if you still get errors.