简体   繁体   中英

implicit declaration of function '_strnicmp' is invalid in C99

I'm new in 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.

You should remove that #define and use the function strncasecmp , since strncasecmp is a POSIX function , and iOS is POSIX-compliant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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