curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: Linking problem with libcurl 8.8.0

From: Aurélien Pierre via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 5 Jun 2024 13:33:13 +0200

Thanks for your answer.

Actually, the problem was identified today :
https://github.com/aurelienpierreeng/ansel/pull/334/files

CMake module `FindCURL.cmake` defines `CURL_LIBRARIES`, while the
`CURLConfig.cmake` config generated by cURL when built with CMake
doesn't. Meaning we are then entirely relying on how packagers build
libcurl.

The future-proof solution is that all CMake projects should configure it
manually, even if it seems to work (especially on Linux) without doing
it. Might be worth mentionning somewhere in your docs. Here is our CMake
config for future reference :

    find_package(CURL REQUIRED)
    if(TARGET CURL::libcurl)
       set(CURL_LIBRARIES CURL::libcurl)
    endif()
    include_directories(SYSTEM ${CURL_INCLUDE_DIRS})
    list(APPEND LIBS ${CURL_LIBRARIES})
    add_definitions(${CURL_DEFINITIONS})

Le 04/06/2024 à 23:20, Daniel Stenberg a écrit :
> On Tue, 4 Jun 2024, Aurélien Pierre via curl-library wrote:
>
>> D:/a/ansel/ansel/src/src/common/curl_tools.c:29:(.text+0xde):
>> undefined reference to `__imp_curl_easy_reset'
>> D:/a/_temp/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>> D:/a/ansel/ansel/src/src/common/curl_tools.c:34:(.text+0x186):
>> undefined reference to `__imp_curl_easy_setopt'
>> D:/a/_temp/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>> D:/a/ansel/ansel/src/src/common/curl_tools.c:37:(.text+0x1c2):
>> undefined reference to `__imp_curl_easy_setopt'
>> D:/a/_temp/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>> D:/a/ansel/ansel/src/src/common/curl_tools.c:40:(.text+0x1f4):
>> undefined reference to `__imp_curl_easy_setopt'
>
> This looks like FAQ entry 5.7:
>
> https://curl.se/docs/faq.html#Link_errors_when_building_libcur
>

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-06-05