We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
% make cc -D_POSIX_C_SOURCE=2 -std=c99 -Wall -g -o imcat imcat.c -lm imcat.c:87:4: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration] snprintf( tripl, sizeof(tripl), "%d;%d;%dm ", r,g,b ); ^ imcat.c:87:4: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf' 1 error generated. make: *** [imcat] Error 1
My envairement:
% gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 13.0.0 (clang-1300.0.29.30) Target: arm64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin % g++ -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 13.0.0 (clang-1300.0.29.30) Target: arm64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
The text was updated successfully, but these errors were encountered:
Same here. But you've already know this is something wrong with clang, there is nothing helpful with gcc version info. My Solution:
Makefile
imcat
cc -g -o imcat imcat.c -lm
Not much sure what is really wrong there, this just works.
clang version: Apple clang version 13.1.6
Apple clang version 13.1.6
Sorry, something went wrong.
stdio.h is the first included file. I have no idea why MacOS clang can't find it. I'm kinda stomped on this.
stdio.h
Can you try adding -D_DARWIN_C_SOURCE to the Makefile?
-D_DARWIN_C_SOURCE
No branches or pull requests
My envairement:
The text was updated successfully, but these errors were encountered: