0

I'm using a port of getopt_long for windows which has the following lines:

[...]
static char * __progname __P((char *));
int getopt_internal __P((int, char * const *, const char *));

static char * __progname(nargv0) char * nargv0;
{
    char * tmp;
    [...]

I'm not familiar with the synatx and works fine with a simple project but when I use it in a bigger project I get the following error while compiling:

..\getopt_long.c(52): error C2365: '__progname' : redefinition; previous definition was 'function'
      ..\getopt_long.c(49) : see declaration of '__progname'

I'm guessing there's a flag that tells cl not to expand __progname(nargv0), do you know which one could it be? Is this information enough to spot the error? or might it be somewhere else?

Some of the flags:

 [...] /Zi /nologo /W1 /WX- /MP /O2 /Ob2 /D WIN32 /D _WINDOWS /D _AMD64_ /D WITH_PNG /D WITH_OPENMP /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /openmp

and the working one:

   C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c [...] /nologo /W1 /WX- /MP /O2 /Ob2 /D WIN32 /D _WINDOWS /D WINDOWS /D NOMINMAX /D _AMD64_ /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /openmp [...] /Gd /TP /errorReport:queue ..\hello.cpp  /w
4

0 回答 0