SDWebImage / SDWebImageWebPCoder

A WebP coder plugin for SDWebImage, use libwebp
MIT License
221 stars 86 forks source link

Call to undeclared function 'SD_LOG'; ISO C99 and later do not support implicit function declarations #112

Closed Jack-Rain closed 3 months ago

Jack-Rain commented 3 months ago

When I use "pod 'SDWebImageWebPCoder', :path=> '/Users/xxx/SDWebImageWebPCoder-master'" to point SDWebImageWebPCoder to a local file, I get the error "Call to undeclared function 'SD_LOG'; ISO C99 and later do not support implicit function declarations" during compilation.

dreampiggy commented 3 months ago

Upgrade to the latest version, I think this already been fixed. This macro exists in SDInternalMacros.h, which the private search path pointed to

https://github.com/SDWebImage/SDWebImageWebPCoder/blob/master/SDWebImageWebPCoder/Private/SDInternalMacros.h

Jack-Rain commented 3 months ago

Upgrade to the latest version, I think this already been fixed. This macro exists in SDInternalMacros.h, which the private search path pointed to

https://github.com/SDWebImage/SDWebImageWebPCoder/blob/master/SDWebImageWebPCoder/Private/SDInternalMacros.h

it is already the latest version

dreampiggy commented 3 months ago

You can check your environment, open in Xcode project and jump into SDImageWebPCoder.m, go to

#import "SDInteralMacros.h"

Command + Click this line, where that SDInternalMacros.h pointed to ? Is that a broken file or something inside SDWebImage (not SDWebImageWebPCoder ?)

Jack-Rain commented 3 months ago

You can check your environment, open in Xcode project and jump into SDImageWebPCoder.m, go to

#import "SDInteralMacros.h"

Command + Click this line, where that SDInternalMacros.h pointed to ? Is that a broken file or something inside SDWebImage (not SDWebImageWebPCoder ?)

It points to SDWebImageWebPCoder where the definition of SD_LOG is not included.

Jack-Rain commented 3 months ago

SDTest.zip This demo can reproduce the issue

dreampiggy commented 3 months ago

Is this because the SDInternalMacros.h copied from SDWebImage Core is not updated ?

dreampiggy commented 3 months ago

I mean, where this SD_LOG is used ? SDWebImageWebPCoder itself seems does not have any call to this SD_LOG macro

dreampiggy commented 3 months ago

I guess it's bug or issue on CocoaPods.

These 2 repo contains different path for the same file name SDInternalMacros.h, but it should not cause issue, if exists, it's Package Manager's bug (CocoaPods)

Jack-Rain commented 3 months ago

I mean, where this SD_LOG is used ? SDWebImageWebPCoder itself seems does not have any call to this SD_LOG macro image

Jack-Rain commented 3 months ago

I guess it's bug or issue on CocoaPods.

These 2 repo contains different path for the same file name SDInternalMacros.h, but it should not cause issue, if exists, it's Package Manager's bug (CocoaPods)

maybe

dreampiggy commented 3 months ago

For local development, avoid the default configuration and always use

install! 'cocoapods', :generate_multiple_pod_projects => true