User forums > Help
Implicit Declaration of Function - HELP!
biscuit_5:
Hi Guys,
I literally copied the code exactly as you see in the YouTube tutorial below and I get "Implicit declaration of function". However, the teacher in the video is not getting an error. He is using CodeBlocks as well. Does anyone know why it might not be working? I am listing the code exactly below for your reference as well. The only thing I can think of is that I am using a mac, but I followed the installation instructions perfectly. I also did not have any issues with any other codes until now.
https://youtu.be/KJgsSFOSQv0?t=6035
#include <stdio.h>
#include <stdlib.h>
int main()
{
sayHi();
return 0;
}
void sayHi() {
printf("Hello User");
}
sodev:
This is not your how-do-i-code forum nor your youtube-does-not-work-forum. Your question is a general programming question and off topic for this forum.
I doubt you copied the code exactly, because ... order does matter. You cannot call anything before it has been declared.
biscuit_5:
How is it a "how-to code" question and not a code blocks question? The code is exact and does not work for me. Yet it does for someone else using code blocks. If you actually read the code and looked at the video as a reference instead of being a prick, you would realize that. If you aren't interested in helping, don't respond. Act as you should in public. I know you wouldn't be that condescending to me in person.
stahta01:
--- Quote from: biscuit_5 on May 29, 2019, 01:09:28 am ---How is it a "how-to code" question and not a code blocks question? The code is exact and does not work for me. Yet it does for someone else using code blocks. If you actually read the code and looked at the video as a reference instead of being a prick, you would realize that. If you aren't interested in helping, don't respond. Act as you should in public. I know you wouldn't be that condescending to me in person.
--- End quote ---
PLEASE read the rules before you are banned!http://forums.codeblocks.org/index.php/topic,9996.0.html
Also, read this FAQ
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Tim S.
stahta01:
I suggest you learn the difference between a warning and a error!
--- Code: ----------------- Clean: Debug in test (compiler: GNU GCC Compiler)---------------
Cleaned "test - Debug"
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------
x86_64-w64-mingw32-gcc.exe -Wall -g -c C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c -o obj\Debug\main.o
C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c: In function 'main':
C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c:7:5: warning: implicit declaration of function 'sayHi' [-Wimplicit-function-declaration]
sayHi();
^~~~~
C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c: At top level:
C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c:11:6: warning: conflicting types for 'sayHi'
void sayHi() {
^~~~~
C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\main.c:7:5: note: previous implicit declaration of 'sayHi' was here
sayHi();
^~~~~
x86_64-w64-mingw32-g++.exe -o bin\Debug\test.exe obj\Debug\main.o
Output file is bin\Debug\test.exe with size 316.92 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 2 warning(s) (0 minute(s), 0 second(s))
-------------- Run: Debug in test (compiler: GNU GCC Compiler)---------------
Checking for existence: C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\bin\Debug\test.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\bin\Debug\test.exe" (in C:\Users\stahta01\devel\open_source_code\no_version_control\test\test\.)
Process terminated with status 0 (0 minute(s), 2 second(s))
--- End code ---
Tim S.
Navigation
[0] Message Index
[#] Next page
Go to full version