0
g ++やlinuxについては初心者ですが、私が書いたC++プログラムをコンパイルしようとしています。私のインクルードと、文字通りC + +インクルードファイル(stdio.h、string.hなど)から数千行のエラーが出ます。私は下にそれらのいくつかを貼り付け:C++ヘッダーファイルの奇妙なg ++コンパイラエラー
本当に奇妙である何In file included from /usr/include/stdio.h:75,
from /usr/include/root/Rtypes.h:33,
from /usr/include/root/TObject.h:31,
from /usr/include/root/TNamed.h:26,
from /usr/include/root/TAxis.h:25,
from /usr/include/root/TH1.h:25,
from /usr/include/root/TH1F.h:25,
from torusMC.cpp:10:
/usr/include/libio.h: In function ‘int _IO_feof(_IO_FILE*)’:
/usr/include/libio.h:462: error: expected primary-expression before ‘,’ token
/usr/include/libio.h:462: error: ‘printf’ was not declared in this scope
/usr/include/libio.h:462: error: ‘exit’ was not declared in this scope
/usr/include/libio.h: In function ‘int _IO_ferror(_IO_FILE*)’:
/usr/include/libio.h:463: error: expected primary-expression before ‘,’ token
/usr/include/libio.h:463: error: ‘printf’ was not declared in this scope
/usr/include/libio.h:463: error: ‘exit’ was not declared in this scope
、私はまったく同じ別のディレクトリに異なるプログラムの前に含まれており、すべてが(まだ)うまくコンパイルに使用していることです。私がそれらをすべてコメントし、インクルードを使用するコードをコンパイルしても問題ありません。私がコメントを含むインクルードを使用してコードを保持しているが、インクルードの1つでもコメントすると、すべてのエラーが再び発生します。
この1つのディレクトリで失敗するように私の環境に何か問題がありますか?
'/ usr/include/root /'?そのディレクトリを作成したのは何ですか? – sarnold
ルートデータ解析ソフトウェアをインストールしました – user1042305
潜在的なエラーを特定できるようにコードを投稿する必要があります。しかし、埋め込まれたリンクエラーの原因となっているコードのどこかに構文エラーがあるようです。コードの構文エラーを確認して、ここに投稿してください。 –