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

curl/urlapi.h missing include on curl.h #3438

Closed
benkohler opened this issue Jan 4, 2019 · 2 comments

Comments

@benkohler
Copy link

commented Jan 4, 2019

I believe the new urlapi.h should have #include "curl.h" in it. Without that change, #include "curl/urlapi.h" throws ugly errors.

I did this

cc -c -o tm -x c - <<< "#include "curl/urlapi.h""

I expected the following

return success

curl/libcurl version

curl 7.63.0 (x86_64-pc-linux-gnu) libcurl/7.63.0 OpenSSL/1.1.0j zlib/1.2.11
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM SSL libz TLS-SRP UnixSockets HTTPS-proxy

operating system

Gentoo Linux

@benkohler

This comment has been minimized.

Copy link
Author

commented Jan 4, 2019

In file included from :1:
/usr/include/curl/urlapi.h:84:1: error: unknown type name ‘CURL_EXTERN’
CURL_EXTERN CURLU curl_url(void);
^~~~~~~~~~~
/usr/include/curl/urlapi.h:84:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘
’ token
CURL_EXTERN CURLU *curl_url(void);
^
/usr/include/curl/urlapi.h:91:12: error: expected ‘;’ before ‘void’
CURL_EXTERN void curl_url_cleanup(CURLU *handle);
^~~~~
;
/usr/include/curl/urlapi.h:97:1: error: unknown type name ‘CURL_EXTERN’
CURL_EXTERN CURLU *curl_url_dup(CURLU in);
^~~~~~~~~~~
/usr/include/curl/urlapi.h:97:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘
’ token
CURL_EXTERN CURLU *curl_url_dup(CURLU *in);
^
/usr/include/curl/urlapi.h:104:1: error: unknown type name ‘CURL_EXTERN’
CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
^~~~~~~~~~~
/usr/include/curl/urlapi.h:104:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘curl_url_get’
CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
^~~~~~~~~~~~
/usr/include/curl/urlapi.h:112:1: error: unknown type name ‘CURL_EXTERN’
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
^~~~~~~~~~~
/usr/include/curl/urlapi.h:112:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘curl_url_set’
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
^~~~~~~~~~~~

@bagder

This comment has been minimized.

Copy link
Member

commented Jan 4, 2019

We can probably view this as a bug, but note that all documentation says you should #include <curl/curl.h> and I don't think we ever suggest you should directly include any other header when using libcurl... Thus, I don't think your command line test is correct.

@bagder bagder added the build label Jan 4, 2019

bagder added a commit that referenced this issue Jan 5, 2019
curl/urlapi.h: include "curl.h" first
This allows programs to include curl/urlapi.h directly.

Reported-by: Ben Kohler
Fixes #3438

@bagder bagder closed this in ef384c6 Jan 7, 2019

@lock lock bot locked as resolved and limited conversation to collaborators Apr 7, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.