question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] c-ares/1.17.1: fails to build on mingw

See original GitHub issue

Error is

In file included from /root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/source_subfolder/src/lib/ares_setup.h:214,
                 from /root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/source_subfolder/src/lib/ares_cancel.c:15:
/root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/source_subfolder/src/lib/setup_once.h:113:8: error: redefinition of 'struct timeval'
  113 | struct timeval {
      |        ^~~~~~~
In file included from /opt/mingw-w64-build/x86_64-w64-mingw32/x86_64-w64-mingw32/include/winsock2.h:52,
                 from /root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/build_subfolder/source_subfolder/ares_build.h:26,
                 from /root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/source_subfolder/src/lib/ares_setup.h:83,
                 from /root/.conan/data/c-ares/1.17.1/_/_/build/3027a2bf0a64b8cf013441df42862a577f509d52/source_subfolder/src/lib/ares_cancel.c:15:
/opt/mingw-w64-build/x86_64-w64-mingw32/x86_64-w64-mingw32/include/_timeval.h:10:8: note: originally defined here
   10 | struct timeval
      |        ^~~~~~~

The cause is that detection of HAVE_STRUCT_TIMEVAL fails due to

/root/.conan/data/mingw-w64/8.0.2/_/_/package/6c0af486d761293b534496741c71f331201fadf0/lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lAdvapi32

This was fixed upstream in https://github.com/c-ares/c-ares/commit/28b2fa40bd6c4d54bcb182f6caa0af0e5759a138

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: c-ares/1.17.1
  • Operating System+version: Linux Ubuntu 18.04
  • Compiler+version: MinGW 10

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Windows
arch=x86_64
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
compiler.threads=win32
compiler.exception=seh
build_type=RelWithDebInfo
[options]
mingw-w64:threads=win32
[conf]
[build_requires]
*: mingw-w64/8.0.2
[env]

Steps to reproduce (Include if Applicable)

build c-ares/1.17.1 with the above profile

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ericLemanissiercommented, Mar 9, 2022

this is an upstream bug which is solved in c-ares/1.18.1 already available on conan-center.

0reactions
ericLemanissiercommented, Mar 18, 2022

This issue can probably be closed then, right ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

gcc seems broken · Issue #10761 · msys2/MINGW-packages
After updating MSYS2 this morning, I cannot compile my app any more, getting this error: C:/msys64/mingw64/include/c++/11.2.0/cstdlib:75:15: ...
Read more >
MinGW's mingw-get fails downloading packages
I'm trying to set up MinGW. I have downloaded the latest installer, which installs mingw-get but this utility fails to fetch the packages...
Read more >
Get Started with C++ and Mingw-w64 in Visual Studio Code
In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs...
Read more >
Creating Packages - MSYS2
Re-packaging is useful when the process failed in package() and you don't want to run the long build part again. makepkg-mingw takes the...
Read more >
I already have MinGW on my computer. How do I configure it ...
Be aware that in order for any changes to be permanent, the "MATLAB Support for MinGW-w64 C/C++ Compiler" support package must be uninstalled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found