Bitcoin Master Branch breaks when trying compiling becouse of missing MinGW strnlen function #5338

issue LinuXperia opened this issue on November 21, 2014
  1. LinuXperia commented at 8:45 AM on November 21, 2014: none

    Hi.

    Bitcoin master branch compiliation breaks with this error Message here when trying to build it in Windows with MinGW.

    protocol.cpp: In member function 'std::string CMessageHeader::GetCommand() const': protocol.cpp:43:81: error: 'strnlen' was not declared in this scope return std::string(pchCommand, pchCommand + strnlen(pchCommand, COMMAND_SIZE));

    make[2]: *** [libbitcoin_common_a-protocol.o] Error 1 make[2]: Leaving directory /bitcoin/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/bitcoin/src' make: *** [all-recursive] Error 1

  2. laanwj added the label Build system on Nov 21, 2014
  3. laanwj commented at 8:58 AM on November 21, 2014: member

    Seems that strnlen is only spottily supported in mingw: http://sourceforge.net/p/mingw/bugs/1912/

    Which is strange, as the mingw in gitian succeeds in building fine. Maybe some define is necessary...

  4. laanwj commented at 9:43 AM on November 21, 2014: member

    I know the reason: we use mingw-w64 to build, which is a better-maintained fork of mingw

    http://sourceforge.net/projects/mingw-w64/?source=directory

  5. paveljanik cross-referenced this on Nov 21, 2014 from issue Check for strnlen and provide it if it is not found by paveljanik
  6. laanwj closed this on Nov 26, 2014

  7. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC