Closed arademaker closed 28 minutes ago
@arademaker Can you please try to build the package with the configuration option libcurlSharedLib.
It should contain the path to the libcurl shared library as in the following example:
lake -R -KlibcurlSharedLib=/lib/x86_64-linux-gnu/libcurl.so.4 test
Can you provide more instructions about how to use this library?
Please have a look at the example projects.
@arademaker I dont't know why leanc doesn't use -lcurl. A possible ad hoc solution is to reinstall curl, i added a fix to use this approach.
% lake -R -KlibcurlSharedLib=/opt/homebrew/Cellar/curl/8.9.1/lib/libcurl.dylib build
Build completed successfully.
It also worked with libcurl.a
. But I got the error below when I tried #eval main
in the HttpGet example.
Lean server printed an error: libc++abi: terminating due to uncaught exception of type lean::exception: Could not find native implementation of external declaration 'Curl.Extern.curl_version' (symbols 'l_Curl_Extern_curl__version___boxed' or 'l_Curl_Extern_curl__version'). For declarations from `Init`, `Std`, or `Lean`, you need to set `supportInterpreter := true` in the relevant `lean_exe` statement in your `lakefile.lean`.
Do we need the native
folder? Is it possible to rely on the library being already available in the system?
Do we need the native folder?
The native folder contains
Is it possible to rely on the library being already available in the system?
The pre installed library is /usr/lib/libcurl.4.dylib according to otool. The library seems to exist in a cache. I don't know how to access it. So i came up with the reinstall solution.
I added the httpget example to the workflow file.
I was able to compile and run the example!
cd examples/httpget/
lake -R -KlibCurl=/opt/homebrew/Cellar/curl/8.9.1/lib/libcurl.dylib build
.lake/build/bin/httpget
Still, I would like to understand how to import the library in another project and use the library from any #eval
command... I know nothing about the lake file; I need to read spend some time reading about it to undersstand the compilation process.
My attempt to run #eval main
But notice that I do have libcurl installed
The
fetch.c
files isCan you provide more instructions about how to use this library? Say I have another project that wants to use our library as a Python project would normally use the requests library... Maybe basic instruction in the README would be helpful.