Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1445

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

$
0
0

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


Viewing all articles
Browse latest Browse all 1445

Trending Articles