Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link error: cannot find -lcurl #321

Closed
remyers opened this issue Feb 21, 2022 · 5 comments
Closed

link error: cannot find -lcurl #321

remyers opened this issue Feb 21, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@remyers
Copy link
Contributor

remyers commented Feb 21, 2022

Fresh install of Ubuntu 20.04 I get the following link error using ./gradlew :build after following build steps from BUILD.md . Any tips why the curl library is not being found?

> Task :linkDebugTestLinux
e: /home/remyers/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold invocation reported errors
The /home/remyers/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1.
output:
/home/remyers/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold: error: cannot find -lcurl
/tmp/konan_temp3788192268220484282/result.o:out:function libcurl_curl_global_init_wrapper23: error: undefined reference to 'curl_global_init'
/tmp/konan_temp3788192268220484282/result.o:out:function libcurl_curl_slist_append_wrapper27: error: undefined reference to 'curl_slist_append'
...cut
/tmp/konan_temp3788192268220484282/result.o:out:knifunptr_libcurl42_curl_easy_getinfo: error: undefined reference to 'curl_easy_getinfo'

> Task :linkDebugTestLinux FAILED

It seems like libcurl is installed

$ /sbin/ldconfig  -p | grep curl
        libcurl.so.4 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcurl.so.4
        libcurl-gnutls.so.4 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcurl-gnutls.so.4
@sstone
Copy link
Member

sstone commented Feb 21, 2022

Our tests use ktor-client which on linux depends on ktor-client-curl-linuxx64.
It can be fixed with sudo apt install libcurl4-openssl-dev

@remyers
Copy link
Contributor Author

remyers commented Feb 21, 2022

@sstone I couldn't find anything in the build docs about that dependency. Should I do a PR to add it, or perhaps there is a link to the ktor-client dependencies I should add to BUILD.md ?

@remyers
Copy link
Contributor Author

remyers commented Feb 21, 2022

Thanks, btw, that did fix it!

@sstone
Copy link
Member

sstone commented Feb 21, 2022

I think that it's the only library that needs to be installed (on linux, it's not needed on macOS) but I will double check. AFAICT it's not documented anywhere....

@sstone sstone added the documentation Improvements or additions to documentation label Feb 21, 2022
@t-bast
Copy link
Member

t-bast commented Sep 18, 2024

Is this still an issue? If so, can you open a PR to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants