Unable to access stdio.h library

Fully featured ARM compilers available on Windows, Linux, and macOS.
Post Reply
Author
Message
Ladum
Posts: 2
Joined: 06 Apr 2021 21:56

Unable to access stdio.h library

#1 Post by Ladum » 06 Apr 2021 22:16

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();
}
}

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Unable to access stdio.h library

#2 Post by filip » 08 Apr 2021 11:47

Hi,

Did you choose mikroSDK or Legacy libraries when creating new project ?

Regards,
Filip.

Ladum
Posts: 2
Joined: 06 Apr 2021 21:56

Re: Unable to access stdio.h library

#3 Post by Ladum » 08 Apr 2021 18:20

When creating the project I did the Microsdk library.

yongjun.reads
Posts: 1
Joined: 12 Oct 2021 09:28

Re: Unable to access stdio.h library

#4 Post by yongjun.reads » 19 Oct 2021 02:34

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

aminhusni
Posts: 4
Joined: 13 Feb 2022 23:09

Re: Unable to access stdio.h library

#5 Post by aminhusni » 05 Mar 2022 16:18

I am also having problems with sprintf in MikroSDK 2.0 in Necto (Clicker 4 STM32)

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: Unable to access stdio.h library

#6 Post by darko.ilijevski » 16 Mar 2022 17:34

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.

sprintf.jpg
sprintf.jpg (9.05 KiB) Viewed 1685 times

Unfortunately, these libraries have not been released for the mikroSDK2 yet.
BR,
Darko

Post Reply

Return to “ARM AI Compilers”