Это ошибка, которую я получаю, когда пытаюсь скомпилировать код, который использует тауки (не мой код):
.../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;
В файле someelse.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’
Номер строки всегда отличается - объявление не может конфликтовать с самим собой.Я не понимаюКто-нибудь когда-нибудь видел это?