Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: "DYNAMIC" key word ?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: May 30, 2017 9:30 PM Last Post By: Kevin Manuele Threads: [ Previous | Next ]
Kevin Manuele

Posts: 47
Registered: 12/27/02
"DYNAMIC" key word ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 9:30 AM
not sure this is right forum for this, but

I built a 3D physics engine (ReactPhysics3D) using cmake and embarcadero's Clang compiler. Compiled without error.

Then, with a VCL project, I included the physics header file (but no code), and it didn't like "DYNAMIC" in this enum

enum BodyType {STATIC, KINEMATIC, DYNAMIC};

So I changed all instances of DYNAMIC to DINAMIC and the VCL compile was happy.

Then, back at cmake to rebuild engine, it fails with undeclared identifier "DYNAMIC", but this word no longer exists in the referenced cpp file.

Is there a cache somewhere that needs clearing, either in Clang or cmake?

thx

Kevin

BTW: why does a 'tab' character cause these messages to be posted?

Edited by: Kevin Manuele on May 30, 2017 9:31 AM

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: "DYNAMIC" key word ? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 10:23 AM   in response to: Kevin Manuele in response to: Kevin Manuele
Kevin Manuele wrote:

Then, with a VCL project, I included the physics header file (but no
code), and it didn't like "DYNAMIC" in this enum

enum BodyType {STATIC, KINEMATIC, DYNAMIC};

In C++Builder, DYNAMIC is a precompiler macro defined in sysmac.h:

#define DYNAMIC __declspec(dynamic) // For compatibility with Delphi's
old virtual mechanism


If you look various VCL headers, such as Vcl.Controls.hpp, you will see
a lot of class methods are declared as DYNAMIC. They are overrides for
base class methods that were declared in Delphi as 'dynamic' instead of
'virtual'.

In the library header, I would add an #undef statement above the enum
when compiling for C++Builder:

#ifdef SYSMAC_H
#undef DYNAMIC
#endif
 
enum BodyType {STATIC, KINEMATIC, DYNAMIC};


--
Remy Lebeau (TeamB)
Kevin Manuele

Posts: 47
Registered: 12/27/02
Re: "DYNAMIC" key word ? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 9:29 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote

In C++Builder, DYNAMIC is a precompiler macro defined in sysmac.h:

#define DYNAMIC __declspec(dynamic) // For compatibility with Delphi's
old virtual mechanism


If you look various VCL headers, such as Vcl.Controls.hpp, you will see
a lot of class methods are declared as DYNAMIC. They are overrides for
base class methods that were declared in Delphi as 'dynamic' instead of
'virtual'.

In the library header, I would add an #undef statement above the enum
when compiling for C++Builder:

#ifdef SYSMAC_H
#undef DYNAMIC
#endif

enum BodyType {STATIC, KINEMATIC, DYNAMIC};

Thanks, as I suspected.

#undef DYNAMIC works as you suggested, but causes subsequent problems with VCL code.

Kevin

Edited by: Kevin Manuele on May 30, 2017 9:29 PM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02