The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,225 other subscribers

Getting rid of [dcc32 Warning] W1029 Duplicate constructor ‘ClassName.ConstructorName’ with identical parameters will be inacessible from C++

Posted by jpluimers on 2017/11/30

Note that the below solution works for any project raising the W1029 warning (not just from projects using Delphi Mocks) like

[dcc32 Warning] W1029 Duplicate constructor 'ClassName.ConstructorName' with identical parameters will be inacessible from C++

From my original text at [WayBackGet rid of W1029 warning in Delphi compile mode · Issue #106 · VSoftTechnologies/Delphi-Mocks · GitHub:

By default the compiler will emit warnings like these for projects when using either of the Delphi.Mocks.Behavior or Delphi.Mocks.Expectation directly or indirectly:

[dcc32 Warning] W1029 Duplicate constructor 'TExpectation.CreateOnceWhen' with identical parameters will be inacessible from C++

They’re harmless as DUnitX doesn’t support C++. This particular warning type cannot be disabled on the unit or source line level which means you have to disable it on the project level by either:

  1. adding {$WARN DUPLICATE_CTOR_DTOR OFF} anywhere to your .dpr project file
  2. modifying the the Project Options for your project (easiest is in the All configurations - All platforms target):
    1. follow the path Delphi Compiler, Hints and Warnings in the treeview on the left
    2. expand the Output warnings node in the listview on the right
    3. set Duplicate constructor/destructor with identical parameters will be inacessible from C++ to Error

A screenshot of the second option is below.

Note that the spelling mistake in Duplicate constructor/destructor with identical parameters will be inacessible from C++ is how it is in the IDE, but that as Google search string it will give limited results, so here are some back-ground references:

Screenshot of the Project Options

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: