EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Cannot build StreamDevice on Windows 64bit
From: Ralph Lange via Tech-talk <tech-talk at aps.anl.gov>
To: EPICS Tech Talk <tech-talk at aps.anl.gov>
Date: Thu, 9 Sep 2021 14:13:15 +0200
Hi Johannes,

On Thu, 9 Sept 2021 at 14:02, Lehmeyer, Johannes via Tech-talk <tech-talk at aps.anl.gov> wrote:

 

C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:113:15: error: conflicting declaration of 'int strncasecmp(const char*, const char*, size_t)' with 'C' linkage

  113 |   int __cdecl strncasecmp (const char *, const char *, size_t);

      |               ^~~~~~~~~~~

../ChecksumConverter.cc:50:12: note: previous declaration with 'C++' linkage

   50 | static int strncasecmp(const char *s1, const char *s2, size_t n)

      |            ^~~~~~~~~~~

In file included from ../StreamBuffer.h:26,

                 from ../StreamFormatConverter.h:27,

                 from ../ChecksumConverter.cc:58:

C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:116:28: error: redefinition of 'int strncasecmp(const char*, const char*, size_t)'

  116 |   __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); }

      |                            ^~~~~~~~~~~

../ChecksumConverter.cc:50:12: note: 'int strncasecmp(const char*, const char*, size_t)' previously defined here

   50 | static int strncasecmp(const char *s1, const char *s2, size_t n)

      |            ^~~~~~~~~~~


If you look at that place, there's a hint:
#if defined(vxWorks) || defined(_WIN32) || defined(__rtems__)
// These systems have no strncasecmp
static int strncasecmp(const char *s1, const char *s2, size_t n)

Windows does not have str[n]casecmp(), so Stream provides an implementation.
MSYS2 does have it, so you need to fix the preprocessor #if to not provide the function under MSYS2.

Don't forget to offer your fix upstream as a PullRequest.

Cheers,
~Ralph


Replies:
RE: Cannot build StreamDevice on Windows 64bit Freddie Akeroyd - STFC UKRI via Tech-talk
References:
Cannot build StreamDevice on Windows 64bit Lehmeyer, Johannes via Tech-talk

Navigate by Date:
Prev: Cannot build StreamDevice on Windows 64bit Lehmeyer, Johannes via Tech-talk
Next: Windows: Problem building EPICS base, using MSYS2 & mingw Luka Krmpotic via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Cannot build StreamDevice on Windows 64bit Lehmeyer, Johannes via Tech-talk
Next: RE: Cannot build StreamDevice on Windows 64bit Freddie Akeroyd - STFC UKRI via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 09 Sep 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·