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-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
2023-12-12 11:16 AM
Did you specify C++17 for your Project when compiling for AC27? The AC27 DevKit assumes the use of C++17.
2023-12-12 07:20 PM
Hi Bernd, yes I had already set C++17 as the language standard, thanks, but that did not resolve these issues.
2023-12-12 09:21 PM
Hm.. I took a closer look. API_AddParType is defined for the AC27 DevKit. But CParameter is not.
In fact, when I copy your code line into one of my projects, I get the exact same errors and Visual Studio highlights CParameter as missing. So I think it's very likely that somehow you are not properly including the headers which define CParameter. Where do you get this type from?
Best,
Bernd
2023-12-12 09:50 PM - last edited on 2023-12-17 10:56 PM by Laszlo Nagy
Hi Bernd,
It is one of our own classes defined in Parameter.hpp, which is included in the file. here is a large snippet showing the original code and the include. What is peculiar is that the VS IDE happily identifies CParameter, (no red squiggle) and I can navigate to it by pressing F12 on it in the IDE
Regards,
Nick
#ifndef _PARAMETERCOLLECTION_HPP_
#define _PARAMETERCOLLECTION_HPP_
#include "Definitions.hpp"
#include <vector>
#include "WString.hpp"
#include <Parameter.hpp>
using namespace std;
class CParameterCollection
{
protected:
vector<CParameter*> m_collection;
protected:
void ClearCollection();
void CopyCollection(const CParameterCollection &src);
CParameter* Factory(const API_AddParType ¶meter);
2023-12-14 09:07 AM
Hi Nick,
It's a tough one. I don't see anything obviously wrong with the code.
A few questions:
Best,
Bernd
2024-06-21 06:59 AM
Hello,
at first as Bernd pointed out is there any reason you use angle brackets instead of quotes? Please try to modify to
#include "Parameter.hpp"
It is unclear to me whether this error you mentioned refers to CParameter or API_AddParType. Moreover API_AddParType is in APIdefs_LibraryParts.h but I cannot see where it is included. Please try to include it.
2024-06-23 09:50 PM
Hi Mihaly,
Thanks for taking a look at the problem we are having.
I did try changing the angle brackets to quotes when Berndt first suggested it, but the errors remained. I think it is worth reiterating that the code (with the angle brackets) compiles fine when the references are to the AC26 API. It only fails when the AC27 API is referenced.
I have tried including a reference to APIdefs_LibraryParts.h, but that also did not help.
Regards,
Nick
2024-06-25 03:31 PM - edited 2024-06-25 03:33 PM
Hi,
Have you tried to predeclare API_AddParType before its first use?
struct API_AddParType;
Best, Akos
2024-06-26 09:45 PM
Hi Akos,
I added that line before the first reference to API_AddParType, but the error output remained exactly the same.
Regards,
Nick