So Iam busy with the Mwifi project and want to use printf(); for some testing, But how do you add the stdio.h library to the code ?
When I try use printf(); I just get an error in the build.
Is there an alternative ?
Windows 10 ESP-IDF/MDF 4.1
How do you add the stdio.h library to a project ?
-
- Posts: 74
- Joined: Fri Dec 04, 2020 4:23 pm
-
- Posts: 364
- Joined: Mon Jan 04, 2021 2:06 pm
Re: How do you add the stdio.h library to a project ?
Hi,
Can you share the error you got?
Can you share the error you got?
-
- Posts: 74
- Joined: Fri Dec 04, 2020 4:23 pm
Re: How do you add the stdio.h library to a project ?
Thanks for the reply.
The error is: I put what I think is necessary but I also have the .txt file with the rest of the error code.
The error is: I put what I think is necessary but I also have the .txt file with the rest of the error code.
Code: Select all
les/__idf_main.dir/no_router_example.c.obj -c ../main/no_router_example.c
../main/no_router_example.c: In function 'app_main':
../main/no_router_example.c:280:2: error: expected declaration specifiers before 'printf'
printf("Hello, This is to test the printf() \n"); //Adding to test printf();
^~~~~~
[915/956] Building C object esp-idf/mdebug/CMakeFiles/__idf_mdebug.dir/mdebug_cmd.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
- Attachments
-
- Error.txt
- (4.47 KiB) Downloaded 523 times
-
- Posts: 364
- Joined: Mon Jan 04, 2021 2:06 pm
Re: How do you add the stdio.h library to a project ?
Hi,
Could you share your code, or part of it? I think you may have an error before your printf function call.
Could you share your code, or part of it? I think you may have an error before your printf function call.
-
- Posts: 74
- Joined: Fri Dec 04, 2020 4:23 pm
Re: How do you add the stdio.h library to a project ?
Hey, So here is the code. It is the Mwifi example, I will upload as TXT and .c
- Attachments
-
- no_router_example.c
- (10.99 KiB) Downloaded 558 times
-
- Code.txt
- (10.99 KiB) Downloaded 537 times
-
- Posts: 364
- Joined: Mon Jan 04, 2021 2:06 pm
Re: How do you add the stdio.h library to a project ?
Hi,
You need to change from:
to
Probably this is the issue.
You need to change from:
Code: Select all
void app_main()
printf("Hello, This is to test the printf() \n"); //Adding to test printf();
{
Code: Select all
void app_main()
{
printf("Hello, This is to test the printf() \n"); //Adding to test printf();
-
- Posts: 74
- Joined: Fri Dec 04, 2020 4:23 pm
Re: How do you add the stdio.h library to a project ?
Thanks SO much, I cant believe I missed such a small thing with the brackets.
Who is online
Users browsing this forum: No registered users and 16 guests