Hi all,
I'm currently working on a project that requires the use of the sprintf function but I am unable to access the stdio.h library on the Necto Studio IDE (Specfically for ARM compilers). I've already searched the library manager, and reinstalled the compiler thinking it might have been an issue with installing the standard C libraries. Below is some sample code, the error for me popping up on the sprintf line, because the program is creating a blank library for stdio.h. Any help is appreciated, thanks!
#include "board.h"
#include "stdio.h"
void application_init()
{
char string[20];
uint8_t num = 12;
sprintf(num, "A dozen is %u /r/n", num);
}
/// @brief Application task.
void application_task()
{
}
/// @brief Application main function.
void main(void)
{
application_init();
while (1)
{
application_task();
}
}
Unable to access stdio.h library
Re: Unable to access stdio.h library
Hi,
Did you choose mikroSDK or Legacy libraries when creating new project ?
Regards,
Filip.
Did you choose mikroSDK or Legacy libraries when creating new project ?
Regards,
Filip.
Re: Unable to access stdio.h library
When creating the project I did the Microsdk library.
-
- Posts: 1
- Joined: 12 Oct 2021 09:28
Re: Unable to access stdio.h library
Hi,
I am new user of Necto Studio and am facing the same issue. I am working with STM32 MCU and USB UART Click and want to use sprintf (or similiar) function to form a string quickly (with float and decimal values) to be sent via UART. however #include <stdio.h> comes out empty.
similiar i am using microSDK library when i created the project.
Regards,
Yongjun
I am new user of Necto Studio and am facing the same issue. I am working with STM32 MCU and USB UART Click and want to use sprintf (or similiar) function to form a string quickly (with float and decimal values) to be sent via UART. however #include <stdio.h> comes out empty.
similiar i am using microSDK library when i created the project.
Regards,
Yongjun
Re: Unable to access stdio.h library
I am also having problems with sprintf in MikroSDK 2.0 in Necto (Clicker 4 STM32)
- darko.ilijevski
- Posts: 581
- Joined: 21 Mar 2017 16:57
Re: Unable to access stdio.h library
Hello,
The stdio.h standard C library was not ported to the mikroE compilers because it mostly contains functions specific to CPU-driven OS architectures (such as file management and access functions). Therefore, only a few functions were ported as a standalone library. One of those is the sprintf() function. When working on a legacy project, the library is readily available from the library manager (after clicking the APPLY button). You can also include it in the memake file by simply adding MikroC.Sprintf inside the dependencies: {} and uses: {} nodes.
Unfortunately, these libraries have not been released for the mikroSDK2 yet.
The stdio.h standard C library was not ported to the mikroE compilers because it mostly contains functions specific to CPU-driven OS architectures (such as file management and access functions). Therefore, only a few functions were ported as a standalone library. One of those is the sprintf() function. When working on a legacy project, the library is readily available from the library manager (after clicking the APPLY button). You can also include it in the memake file by simply adding MikroC.Sprintf inside the dependencies: {} and uses: {} nodes.
Unfortunately, these libraries have not been released for the mikroSDK2 yet.
BR,
Darko
Darko