これは、taucs を使用するコード (私のコードではない) をコンパイルしようとしたときに発生するエラーです。
.../taucs/src/taucs.h:554: error: conflicting declaration ‘typedef struct taucs_ccs_matrix taucs_ccs_matrix’
.../taucs/src/taucs.h:554: error: ‘taucs_ccs_matrix’ has a previous declaration as ‘typedef struct taucs_ccs_matrix taucs_ccs_matrix’
なに?それは自分自身と矛盾していますか?
私は自分自身をつまんだ後、テストヘッダーを作成し、これについて正しいことを確認するためだけに、矛盾する定義を入れました:
ファイル testit.h 内:
#include "somethingelse.h"
typedef struct
{
int n;
} foobar;
ファイル somethingelse.h 内:
typedef struct
{
int n;
} foobar;
案の定、私は得る:
testit.h:6: error: conflicting declaration ‘typedef struct foobar foobar’
somethingelse.h:4: error: ‘foobar’ has a previous declaration as ‘typedef struct foobar foobar’
または、testit.h にこれがある場合:
typedef struct
{
int n;
} foobar;
typedef struct
{
int n;
} foobar;
testit.h:9: error: conflicting declaration ‘typedef struct foobar foobar’
testit.h:4: error: ‘foobar’ has a previous declaration as ‘typedef struct foobar foobar’
行番号は常に異なります。宣言はそれ自体と競合することはありません。理解できません。誰もこれを見たことがありますか?