2023-12-11 08:44 PM - last edited on 2024-09-17 01:07 PM by Doreena Deng
I have a plugin that compiles and works fine in AC26. I am upgrading it to AC27. I have installed the AC27 API kit and changed all references in the project file to the 27.3001 folder.
I now get about 6000 errors, many of them like these:
Code:
CParameter* Factory(const API_AddParType ¶meter);
Errors:
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int
Error C2143 syntax error: missing ',' before '&'
The Visual Studio IDE is able to identify the type API_AddParType and can navigate to the .h file if I press F12 on the type, but the compiler doesn't seem to be able to find it. (See attached image)
Could someone help with what I need to change to resolve this issue?
Solved! Go to Solution.
2024-07-09 09:54 AM - edited 2024-07-09 09:55 AM
Hi Nick,
I gave it a look and was able to get rid of a few errors but unfortunately not all. I don't think there's one single simple solution to solve all of the compilation errors.
Some things that I did:
Getting the include directories right should fix a bunch of issues. Although some includes still don't work as I'd expect and as you've also found previously.
But maybe this things give you at least some path forward.
Hope that helps,
Bernd
2024-07-10 02:45 PM - edited 2024-07-10 02:46 PM
After spending 2-3 hours trying to make it work I found a few major issues:
- you have an Object.hpp both in your add-on's files and in GSRoot, that confuses the compiler. Please rename the file to CObject.hpp and update its references. You may run into similar situations with Attribute.hpp, Element.hpp, and ModelElement.hpp.
- as API_AttributeIndex is no longer an integer but a class on its own, you must modify your code in several places to handle that properly.
- clean up includes, as Bernd mentioned above
- define UNICODE at the project level, and clean up the warnings and errors afterwards
Other issues:
- pens are available only through the pen tables
- some data members became `APIOptional`, you have to check if those have value before using them
- on the pure C++ side, several generic recommendations come to my mind → please look at C++ programming best practices.
Best, Akos
2024-07-12 04:11 AM
Hi Akos,
Thanks very much for spending the time on this, and you found the solution, which seems easy when you know the answer; multiple similarly names files. This also explains why our plugin compiled for AC26, but wouldn't for AC27.
I have renamed the (+-7) files with duplicate names, and have got the errors down to just 8, and most of them refer to Graphisoft files in the C:\Program Files\GRAPHISOFT\API Development Kit 27.3001\Support\ area. It seems highly unlikely there are problems in those files (Array.hpp, BM.hpp, and a Microsoft file xstddef) and is more likely to be a compatibility/version issue. I have attached the updated project again.
I would really appreciate it if you could have a look at it.
2024-07-12 03:36 PM
Hi,
Here's the modified project; I had to add a few #includes because my ATL installation was in a different directory. I recommend using a compare and merge tool to add the changes to your setup.
Both the Debug and Release x64 targets were compiled and linked properly; I left the Release add-on in the .zip in the Release directory.
Hope this helps,
Akos
2024-07-15 09:54 PM
Hi Akos,
Thank you very much for putting in all your effort to resolve this issue for us; I really appreciate it.
Regards,
Nick
2024-07-17 11:57 AM
Hi Nick,
You are welcome!
🙂 Akos