プロジェクトに取り組んでいて、次のエラーが発生しました
Error (active) the default constructor of "Input" cannot be referenced -- it is a deleted function EquationSolver c:\Users\Kim\Documents\Visual Studio 2015\Projects\EquationSolver\EquationSolver\main.cpp 10
Error C2280 'Input::Input(void)': attempting to reference a deleted function EquationSolver <project_dir>\main.cpp 10
これではエラーの原因を突き止めることはほぼ不可能なので、gcc with でコンパイルしてみた-Wall
ところ、以下のような出力が得られました。
main.cpp: In function 'int main()':
main.cpp:10:9: error: use of deleted function 'Input::Input()'
Input input;
^~~~~
In file included from main.cpp:2:0:
Input.hpp:16:7: note: 'Input::Input()' is implicitly deleted because the default definition would be ill-formed:
class Input
^~~~~
Input.hpp:16:7: error: use of deleted function 'Expressions::Expressions()'
In file included from Input.hpp:11:0,
from main.cpp:2:
Expressions.hpp:8:7: note: 'Expressions::Expressions()' is implicitly deleted because the default definition would be ill-formed:
class Expressions
^~~~~~~~~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
Expressions.hpp:17:8: note: 'Expressions::Vec& Expressions::left' should be initialized
Vec& left;
^~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
class Expressions
^~~~~~~~~~~
Expressions.hpp:18:8: note: 'Expressions::Vec& Expressions::right' should be initialized
Vec& right;
^~~~~
この出力ははるかに詳細であり、間違った場所&
(クラス メンバーは である必要があります) でVec left
あった原点をすばやく見つけるのに役立ちましたVec& left
。
Visual Studio を冗長にすることはできますか?
Visual Studio を に配置すると/Wall
、1800 を超える警告が表示されますが、ほとんどはプロジェクトとはまったく関係ありませんが、それでもこれら 2 つのエラーしか表示されません。