Reputation: 949
I want to create a C++ Builder DLL project that doesn't use VCL. But I get this error in sysmac. Does anyone know the possible cause of this error?
Upvotes: 0
Views: 5007
Reputation: 11
E2040 Declaration terminated incorrectly (C++)
A declaration has an extra or incorrect termination symbol, such as a semicolon placed after a function body.
A C++ member function declared in a class with a semicolon between the header and the opening left brace also generates this error.
Upvotes: 1
Reputation: 1941
This means that you're including a VCL header somewhere in your project - most likely in a file that is compiled as C unit (hence the syntax errors).
You can turn on "Extended error information" in the project options to track down the responsible module.
Upvotes: 0
Reputation: 51719
At a guess (because it's about 5 years since I would with C++ Builder) it's because sysmac.h requires the VCL, from this VCL Overview
The __declspec keyword is provided for language support with the VCL to overcome the previously mentioned items. The sysmac.h file provides macros that you should use if you need to use this keyword. The __declspec variations are discussed next
Upvotes: 1