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

libcurl example doesn't seem to work #12255

Closed
lkadalski opened this issue Jul 27, 2022 · 2 comments
Closed

libcurl example doesn't seem to work #12255

lkadalski opened this issue Jul 27, 2022 · 2 comments
Labels
question No questions on the issue tracker, please.

Comments

@lkadalski
Copy link

lkadalski commented Jul 27, 2022

Hello there, I'm trying to use curl from simple zig program but it doesn't behave as mentioned in resolved ticket originally posted by @lithdew in #988 (comment)

Using zig 0.9.1(and I belive newer) current output is:

./src/bin/curl_c_lib.zig:16:39: error: expected type 'c_uint', found '@Type(.EnumLiteral)'
    try wrap(c.curl_easy_setopt(curl, .CURLOPT_URL, "www.example.org"));
                                      ^

I'm using macos Monterey 12.5

@lkadalski lkadalski changed the title Just wanted to comment here for anyone trying to use libcurl that enum handling already works in the way @andrewrk mentioned. libcurl example doesn't seem to work Jul 27, 2022
@Luukdegram
Copy link
Member

Since the release of Zig 0.9.0 we no longer support C-style enums, and translate-c now converts them into constants instead. You can read more about these changes in the release-notes found here: https://ziglang.org/download/0.9.0/release-notes.html#C-Translation.
We have a more up-to-date CURL example on the website of Zig which can be found here: https://ziglang.org/learn/samples/#using-curl-from-zig

The issue tracker is meant for bugs found in the Zig toolchain, so I'm closing this issue. If you have any further questions, I'd suggest joining one of the friendly communities found at https://github.com/ziglang/zig/wiki/Community.

@Luukdegram Luukdegram added the question No questions on the issue tracker, please. label Jul 27, 2022
@lkadalski
Copy link
Author

Thanks, this is what I was looking for! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No questions on the issue tracker, please.
Projects
None yet
Development

No branches or pull requests

2 participants