提问人:rontgen 提问时间:5/3/2016 最后编辑:rontgen 更新时间:5/25/2016 访问量:1381
VS2015 错误 lnk2001 无法解析的外部符号__imp___vsnprintf
VS2015 error lnk2001 unresolved external symbol __imp___vsnprintf
问:
最近,我将IDE从VS2013更改为VS2015。
将所有平台工具集都设置为VS2015(v140)时,我收到错误:
error lnk2001 unresolved external symbol __imp___vsnprintf
我添加代码如下:
#if _MSC_VER>=1900
#define STDC99
extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }
#else
#ifndef snprintf
#define snprintf _snprintf
#endif
#endif
但我仍然收到如下错误:
cocos2d-x\cocos\platform/win32/CCStdC-win32.h(54): error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int (compiling source file ..\audio\win32
\MciPlayer.cpp)
cocos2d-x\cocos\platform/win32/CCStdC-win32.h(54): error C2143: syntax error: missing ';'
before '{' (compiling source file ..\audio\win32\MciPlayer.cpp)
cocos2d-x\cocos\platform/win32/CCStdC-win32.h(54): error C2146: syntax error: missing ';'
before identifier '__iob_func' (compiling source file ..\audio\win32\MciPlayer.cpp)
cocos2d-x\cocos\platform/win32/CCStdC-win32.h(54): error C2447: '{': missing function
header (old-style formal list?) (compiling source file ..\audio\win32\MciPlayer.cpp)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\corecrt_wstdio.h(28):
error C2378: 'FILE': redefinition; symbol cannot be overloaded with a typedef
(compiling source file ..\editor-support\cocostudio\CCActionFrameEasing.cpp)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\corecrt_wstdio.h(287):
error C2061: syntax error: identifier 'FILE' (compiling source file ..\base\s3tc.cpp)
在 VS2015 中:
typedef struct _iobuf
{
void* _Placeholder;
} FILE;
#define stdin (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))
在 VS2013 中:
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;
#define stdin (&__iob_func()[0])
#define stdout (&__iob_func()[1])
#define stderr (&__iob_func()[2])
FILE 有两个定义。我该如何解决?
答: 暂无答案
评论