Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by jordiblasi on March 9, 2016

Hello,

I am new to freertos and I am trying to test the Network and FAT demo. I am trying to compile it with Microsoft Visual Studio 2015. When I try to compile It I get the following errors on the stdio.h file:

Warning C4005 'vsnprintf': Macro redefinition Error C1189 #error: Macro definition of vsnprintf conflicts with Standard Library function declaration RTOSDemo

On StackOverflow I have found a reference to a similar problem but solution does not work for me: http://stackoverflow.com/questions/27754492/vs-2015-compiling-cocos2d-x-3-3-error-fatal-error-c1189-error-macro-definiti

What I am missing?

Thanks in advance.


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by edwards3 on March 9, 2016

Looks like a compiler version difference issue. Did you grep for #defines like the example in your link?


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by jordiblasi on March 9, 2016

I commented all the #defines related to vsnprintf but I got errors relating to _vsnprintf function.

Error C2084 la función 'int vsnprintf(char *const ,const sizet,const char *const ,va_list)' ya tiene un cuerpo


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by heinbali01 on March 9, 2016

Yes I had the same when moving from VS2010 to VS2015. In earlier versions, snprintf() was considered unsafe and and alternative (_snprintf) had to be used.

This could be used as well:

~~~~ #if MSCVER < 1500 #define snprintf _snprintf #define vsnprintf _vsnprintf #define strdup _strdup #endif ~~~~

Adeu/adios.


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by oscarlpez on August 4, 2016

Hi,

Has finally anybody solve successfully this issue? I am not sure in which file need to be included the previous solution. In stdio.h file? Thanks for sharing.

Oscar


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by rtel on August 4, 2016

It is not clear to me why you think the problem has not been solved, or why it is a problem at all - it just depends on which version of Visual Studio you are using.

Did you try Hein's solution?


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by oscarlpez on August 5, 2016

I was trying Hein's solution, but I don´t know which file mofify, or in which file should be included the changes. I am using VS2015.

Thanks again Oscar


#error Macro definition of vsnprintf conflicts with Standard Library function declaration

Posted by rtel on August 5, 2016

Did you try grep'ing the directory structure for where the function names snprintf and _snprintf already occur in a macro? From the thread it sound like you just need to remove or update the macro mapping.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists