3
extern "C"
{
#endif
#include <stdint.h>
#include <limits.h>
#include "attributes.h"
}
#endif
我加extern "C" { }
然後我得到了C2059 string
錯誤 所以我試圖用#endif
,現在我還有一個4個錯誤。C2059語法錯誤'string'?
Error 1 error C2059: syntax error : 'string' d:\c-sharp\c++
compiling\consoleapplication7\consoleapplication7\libavutil\rational.h 31 1
ConsoleApplication7
我該如何解決這個字符串錯誤?
爲什麼你首先做這個? – 2013-04-23 12:37:34
'#ifdef X ... #endif'通常是怎麼回事,而不是'#endif'兩次。除非你還沒有發佈你的所有代碼? – 2013-04-23 12:37:36
'extern「C」{'聲明和關閉'}'通常會被'#ifdef __cplusplus','#endif'包圍。如果你不這樣做,你必須確保你的頭文件不包含在C源代碼文件中 – simonc 2013-04-23 12:38:35