简体   繁体   English

函数'_strnicmp'的隐式声明在C99中无效

[英]implicit declaration of function '_strnicmp' is invalid in C99

I'm new in iOS 我是iOS新手

now i counter a problem 现在我解决一个问题

#define strncasecmp _strnicmp

it has a warning: 它有一个警告:

implicit declaration of function '_strnicmp' is invalid in C99

and also has error: 并且也有错误:

Undefined symbols for architecture armv7:
"__strnicmp", referenced from:
  _AVI_open_input_file in avilib.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How to solve this problem? 如何解决这个问题呢?

Quite simply, your C runtime doesn't have the function _strnicmp , which is a Microsoft-specific function , not a standard C function. 很简单,您的C运行时没有_strnicmp函数,这是Microsoft特定的函数 ,而不是标准的C函数。

You should remove that #define and use the function strncasecmp , since strncasecmp is a POSIX function , and iOS is POSIX-compliant. 您应该删除该#define并使用功能strncasecmp ,因为strncasecmpPOSIX函数 ,并且iOS兼容POSIX。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM