Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: petec on March 28, 2019, 04:26:17 am

Title: 'fprint' was not declared in this scope|
Post by: petec on March 28, 2019, 04:26:17 am
When I try to build I get the error below:

main.cpp|18|error: 'fprint' was not declared in this scope|

My code includes:
#include <stdio.h>

I found 3 files named stdio.h in the Code::Blocks directorys.
None of them have fprint in them.
I am using Code::Blocks 17.12 on Windows 8.1
Title: Re: 'fprint' was not declared in this scope|
Post by: oBFusCATed on March 28, 2019, 08:37:55 am
https://en.cppreference.com/w/cpp/io/c/fprintf

Next time please use a search engine... And read the rules of the forum before posting...
Title: Re: 'fprint' was not declared in this scope|
Post by: petec on March 29, 2019, 03:10:08 am
I don't think it is appropriate for you to chastise me for not using search engines,
I searched and followed the links including stackoverflow and couldn't find a solution.

Now, tell me, what was I supposed to find in that link you gave me that would solve my problem!  I read it top to bottom three times.

I also did a ctrl-f on the page and searched it for "declared" and "scope" and neither words are on the page.

Big help you are!

Pete
Title: Re: 'fprint' was not declared in this scope|
Post by: sodev on March 29, 2019, 04:41:04 am
I'm afraid no one can help you. Not even Google. If you can't see after reading the page three times that the function is called fprintf, maybe visit a doctor?
Title: Re: 'fprint' was not declared in this scope|
Post by: raynebc on March 29, 2019, 04:57:46 pm
It was appropriate for you to be chastised, as you ignored the purpose of this forum as a resource for help using the IDE and not programming help in general.  Keep practicing and you'll learn to be able to solve these issues yourself.
Title: Re: 'fprint' was not declared in this scope|
Post by: petec on March 30, 2019, 03:16:07 am
Well, explain why this exact code compiles on my raspberry pi but not on Windows 8.1.

That is why I assumed it was something to do with codeblocks not the code.
Title: Re: 'fprint' was not declared in this scope|
Post by: stahta01 on March 30, 2019, 04:05:21 am
Well, explain why this exact code compiles on my raspberry pi but not on Windows 8.1.

That is why I assumed it was something to do with codeblocks not the code.

Learn the name and version of the Compiler being used on both systems.
Then, try building the code with the same mistyping on both systems.

NOTE: Code::Blocks is not an Compiler! Read the CB FAQs.

Tim S.