win7 x64 PCでmetis 5.0.2をダウンロードして正常にコンパイルし、 metismexをコンパイルしようとしました。私は、Visual Studio 11 (2012) で metis をコンパイルし、matlab 内から同じコンパイラを使用しました。大量のエラー (主にライブラリ内からのパスの問題によるもの) で多くの実験を行った後、c と c++ に関する私の知識はかなり基本的なものであるため、続行する方法がわからないところまで来ました。だから、ここにエラーがあります:
../GKlib/mat_libs/.\stddef.h(16) : error C2054: expected '(' to follow '_SIZE_TYPE__'
../GKlib/mat_libs/.\stddef.h(19) : error C2085: '_WCHAR_TYPE__' : not in formal parameter list
インライン関数などを知りましたが、エラーがライブラリ内にあり、何をすべきか正確にわからないため、ここにいます。そのため、エラー コードは次のように生成されます。
typedef __SIZE_TYPE__ size_t;
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
#endif
それを台無しにすることなく何をすべきかについて何か提案はありますか? (wchar型をコメントアウトした場合、prtdiff_typeでも同じエラーが発生します)よろしくお願いします
PS: 必要な場合に備えて、sttdef.h 全体を以下に示します。
/* Copyright 2012 The MathWorks, Inc. */
#ifndef _STDDEF_H
#define _STDDEF_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
# define NULL (0)
#else
# define NULL ((void *)0)
#endif
typedef __SIZE_TYPE__ size_t;
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
#endif
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#if (! defined(__cplusplus)) || (! defined(PST_GNU))
# define offsetof(type, field) ((size_t) &((type *)0)->field)
#else
# define offsetof(type, field) \
(__offsetof__(reinterpret_cast<size_t> \
(&reinterpret_cast<const volatile char &> \
(static_cast<type *>(0)->field))))
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _STDDEF_H *
/