无法parsing的外部符号_stricoll

我正在将Python库移动到依赖于某些c代码的Windows平台。 但是,我没有build立在Windows下,得到:

util.obj : error LNK2019: unresolved external symbol _strtoll 

不好的代码是:

 x_space[j].index = (INT64)strtoll(idx,&endptr,10); 

我的编译器是VS2010,在XP 32位下使用。 而我的make文件是:

 CXX = cl.exe CFLAGS = /nologo /O2 /EHsc /I. /D _WIN32 /D _CRT_SECURE_NO_DEPRECATE TARGET = . lib: util.c $(CXX) $(CFLAGS) -LD util.c /Iliblinear -Fe$(TARGET)\util -link -DEF:util.def 

我怎么能解决这个问题?

Microsoft标准C库不包含strtoll()从C字符串转换为long long的定义。

MS提供了另一个名为_strtoi64()函数,它执行相同的操作,并且具有完全相同的签名 – 只要在MSVC下使用它或者为strtoll定义一个宏strtoll

 __int64 _strtoi64( const char *nptr, char **endptr, int base );