スレを勃てるまでもないC/C++の質問はここで 8
at TECH
165:デフォルトの名無しさん
09/03/07 20:28:02
URLリンク(mist000.h18.ru)
メンバーイニシャライザを使用したコンストラクタをクラス定義の外に分離したいんだが、
g++でコンパイルするとこのようなエラーが出る。
--------------------------------------------------------
uha@seven:~/dev/uhaww$ g++ -Wall -o debug debug.cpp
debug.cpp: In constructor ‘TestException::TestException(std::string&)’:
debug.cpp:8: error: ‘sCause’ was not declared in this scope
debug.cpp:8: error: expected `{' at end of input
debug.cpp: At global scope:
debug.cpp:10: error: redefinition of ‘TestException::TestException(std::string&)’
debug.cpp:8: error: ‘TestException::TestException(std::string&)’ previously defined here
--------------------------------------------------------
分離すること自体考えてはいけないのだろうか...
メンバーイニシャライザ使わなければ分離できるのに。。
間違いがあればよろしくお願いします。
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5380日前に更新/124 KB
担当:undef