Moved from cygwin to VisualStudio2013, error LNK2019, snprintf (), c

I am trying to run a unix compiler project written in c with MS Visual-Studio 2013 and I cannot get rid of the following error:

error LNK2019: unresolved external symbol "_snprintf" referenced in 
    function "PUBLIC void SyntaxError( int Expected, TOKEN CurrentToken )"

      

If I realized that this is a problem where VisualStudio cannot find the body / declaration from the function snprintf()

to be defined in stdio.h

.

The project works fine with cygwin. I had to add _CRT_SECURE_NO_WARNINGS

in the preprocessor settings to get this far, but I don't think it has an impact.

Here is the named function:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "line.h"
#include "strtab.h"
#include "scanner.h"

[..code..]


PUBLIC void   SyntaxError( int Expected, TOKEN CurrentToken )
{
    char s[M_LINE_WIDTH+2];

    snprintf( s, sizeof(s), "Syntax: Expected %s, got %s\n", Tokens[Expected], Tokens[CurrentToken.code] );
    Error( s, CurrentToken.pos );
}

      

If you can help me, or if there is anything else you need to know, please tell me. This is my third day and I am running out of ideas;).

Until now ... Tobias

+3


source to share


1 answer


The name of this function with an underscore MSVC compiler _snprintf()

.



+4


source







All Articles