Latest FFMPEG compilation method (strcasecmp)

Source: Internet
Author: User

The specific preparations before compilation will not be too long-winded, or the same mingw will be OK.

After downloading the FFMPEG source code and compiling it in mingw, the following error occurs: "libavformat/metadata. C: 133: 17: Error: Implicit declaration of function 'strcasecmp '",

(The strcasecmp statement is inaccurate .)
Two functions are implemented by yourself.

#ifndef __STRCASECMP_H____#define __STRCASECMP_H____static inline char __hack_charget( char c ){if(c >= 'a' && c <= 'z')c += 'A' - 'a';return c;}static inline int hack_strcasecmp( char const *a, char const *b ){char ac, bc;int r;for(;;) {ac = __hack_charget(*a++);bc = __hack_charget(*b++);r = (int)ac - (int)bc;if(r)return r;if(!ac)return 0;}}static inline int hack_strncasecmp( char const *a, char const *b, int n ){char ac, bc;int r, i;for(i = 0; i < n; ++i) {ac = __hack_charget(*a++);bc = __hack_charget(*b++);r = (int)ac - (int)bc;if(r)return r;if(!ac)return 0;}return 0;}#define strcasecmp hack_strcasecmp#define strncasecmp hack_strncasecmp#endif

Stored as strcasecmp. h In the mingw include directory.
Include this file in avstring. h and metadata. h. The problem is solved.

Original Author address: Click to open the link

Thank you very much!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.