Menu

#1181 Build fails on MinGW due to trying to link ws2_32.lib

closed-fixed
None
5
2013-06-21
2013-01-12
arsenm
No

The patch here is wrong for MinGW (the .lib suffix): https://sourceforge.net/p/curl/bugs/1031/
This also appears to be similar to the bug here:
https://sourceforge.net/p/curl/bugs/1049/

target_link_libraries(libcurl ws2_32) should be enough, but there's a problem with how this works now. Why is this using CMAKE_C_STANDARD_LIBRARIES instead of the normal library handling? Things would work as expected (adding the -l for MinGW etc.) if using the normal target_link_libraries. I had never even heard of this variable before, but it seems to be a dumb string that gets appended to the link line.

I would suggest not using CMAKE_C_STANDARD_LIBRARIES at all.

Discussion

  • arsenm

    arsenm - 2013-01-12

    I'm using 7.28.1

     
  • arsenm

    arsenm - 2013-01-12

    This will also be broken if LDAP is enabled / it tries to use wldap32.lib

     
  • Daniel Stenberg

    Daniel Stenberg - 2013-01-12

    Thanks for your report. Can you please submit a complete patch so that we get completely what you mean? The cmake build stuff in curl is not widely understood nor used...

     
  • arsenm

    arsenm - 2013-01-12

    I submitted the fix here:

    https://github.com/bagder/curl/pull/53

     
  • Daniel Stenberg

    Daniel Stenberg - 2013-02-11
    • labels: cmake, mingw, build, windows -->
    • status: open --> closed-fixed
    • assigned_to: Daniel Stenberg
    • milestone: -->
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-02-11

    This is merged into git already!

     
MongoDB Logo MongoDB