samir105
samir105

Reputation: 949

C++ Builder [C++ Error] sysmac.h(58): E2040 Declaration terminated incorrectly

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

Answers (3)

Zheuzhyk
Zheuzhyk

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.

http://docwiki.embarcadero.com/RADStudio/XE3/en/E2040_Declaration_terminated_incorrectly_%28C%2B%2B%29

Upvotes: 1

Moritz Beutel
Moritz Beutel

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

Binary Worrier
Binary Worrier

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

Related Questions