Discussion:
build/use curl for linux
Dung Nguyen
2014-01-06 08:54:34 UTC
Permalink
hi!
i need to port my application from Windows to Ubuntu/Arm Linux
i'm jz noob in linux, my application use Lazarus/Pascal header of curl

i'm trying to build the curl from source in Ubuntu but seem it not work,
what is the correct way of usage libcurl in linux ?
Stefano D. Mtangoo
2014-01-06 09:04:30 UTC
Permalink
Post by Dung Nguyen
hi!
i need to port my application from Windows to Ubuntu/Arm Linux
i'm jz noob in linux, my application use Lazarus/Pascal header of curl
i'm trying to build the curl from source in Ubuntu but seem it not
work, what is the correct way of usage libcurl in linux ?
./configure && make
if any fails post error message
Post by Dung Nguyen
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
--
Stefano D. Mtangoo
Mob: +255 754710410
Twitter: @mtangoo
Web. http://hosannahighertech.co.tz
Linkedin: http://www.linkedin.com/pub/stefano-mtangoo/45/644/281
/The purpose of man is to know his Maker Be known by his Maker
And make his Maker known So that others may know his Maker as their
Maker(Emeal Zwayne) /
Václav Zeman
2014-01-06 20:10:34 UTC
Permalink
Please describe what fails for you in detail.
Post by Dung Nguyen
hi!
i need to port my application from Windows to Ubuntu/Arm Linux
i'm jz noob in linux, my application use Lazarus/Pascal header of curl
i'm trying to build the curl from source in Ubuntu but seem it not work,
what is the correct way of usage libcurl in linux ?
--
VZ
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dung Nguyen
2014-01-07 02:43:27 UTC
Permalink
ok, i was trying build curl + ssl
at first i download curl src, open ssl src, put all in desktop
curl
curl/opt/openssl

i install openssl
./config
sudo make
sudo make install

trying to configure curl
./configure
* curl version: 7.34.0*
* Host setup: i686-pc-linux-gnu*
* Install prefix: /usr/local*
* Compiler: gcc*
* SSL support: no
(--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )*
* SSH support: no (--with-libssh2)*
* zlib support: enabled*
* GSSAPI support: no (--with-gssapi)*
* SPNEGO support: no (--with-spnego)*
* TLS-SRP support: no (--enable-tls-srp)*
* resolver: default (--enable-ares / --enable-threaded-resolver)*
* ipv6 support: enabled*
* IDN support: no (--with-{libidn,winidn})*
* Build libcurl: Shared=yes, Static=yes*
* Built-in manual: enabled*
* --libcurl option: enabled (--disable-libcurl-option)*
* Verbose errors: enabled (--disable-verbose)*
* SSPI support: no (--enable-sspi)*
* ca cert bundle: /etc/ssl/certs/ca-certificates.crt*
* ca cert path: no*
* LDAP support: no (--enable-ldap / --with-ldap-lib /
--with-lber-lib)*
* LDAPS support: no (--enable-ldaps)*
* RTSP support: enabled*
* RTMP support: no (--with-librtmp)*
* metalink support: no (--with-libmetalink)*
* HTTP2 support: disabled (--with-nghttp2)*
* Protocols: DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET
TFTP*

okay but i found ssl support = no

so i read from here : http://curl.haxx.se/docs/install.html
and trying with
./configure --with-ssl

*checking whether to enable Windows native SSL/TLS (Windows native builds
only)... no*
*checking whether to enable iOS/Mac OS X native SSL/TLS... no*
*checking for pkg-config... /usr/bin/pkg-config*
*checking for openssl options with pkg-config... found*
*configure: pkg-config: SSL_LIBS: "-lssl -lcrypto "*
*configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib "*
*configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include "*
*checking for CRYPTO_lock in -lcrypto... yes*
*checking for SSL_connect in -lssl... no*
*checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in -lssl... (cached) no*
*no*
*configure: error: OpenSSL libs and/or directories were not found where
specified!*

i check directory that ssl installed
*bin etc games include lib man sbin share src ssl*
****@ubuntu:/usr/local$ cd ssl*
****@ubuntu:/usr/local/ssl$ ls*
*bin certs include lib man misc openssl.cnf private*
****@ubuntu:/usr/local/ssl$ cd lib*
****@ubuntu:/usr/local/ssl/lib$ ls*
*engines libcrypto.a libssl.a pkgconfig*
****@ubuntu:/usr/local/ssl/lib$ ls*
*engines libcrypto.a libssl.a pkgconfig*
****@ubuntu:/usr/local/ssl/lib$ *

i think openssl install correct but why there are error ?
Post by Václav Zeman
Please describe what fails for you in detail.
Post by Dung Nguyen
hi!
i need to port my application from Windows to Ubuntu/Arm Linux
i'm jz noob in linux, my application use Lazarus/Pascal header of curl
i'm trying to build the curl from source in Ubuntu but seem it not work,
what is the correct way of usage libcurl in linux ?
--
VZ
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dan Fandrich
2014-01-07 22:10:07 UTC
Permalink
Post by Dung Nguyen
ok, i was trying build curl + ssl
at first i download curl src, open ssl src, put all in desktop 
curl
curl/opt/openssl
i install openssl
./config
sudo make
sudo make install
trying to configure curl
./configure
[...]
Post by Dung Nguyen
okay but i found ssl support = no
so i read from here : http://curl.haxx.se/docs/install.html
and trying with
./configure --with-ssl
You'll likely have better luck using the PKG_CONFIG_PATH method mentioned just
after that section, or specifying the install location to the --with-ssl
option.
Post by Dung Nguyen
Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dung Nguyen
2014-01-08 02:57:39 UTC
Permalink
env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl
env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl

also result in error


*checking whether to enable iOS/Mac OS X native SSL/TLS... no*
*checking for pkg-config... /usr/bin/pkg-config*
*checking for openssl options with pkg-config... found*
*configure: pkg-config: SSL_LIBS: "-lssl -lcrypto "*
*configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib "*
*configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include "*
*checking for CRYPTO_lock in -lcrypto... yes*
*checking for SSL_connect in -lssl... no*
*checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in -lssl... (cached) no*
*no*
*configure: error: OpenSSL libs and/or directories were not found where
specified!*

./configure --with-ssl=/usr/local/ssl/lib
/configure --with-ssl=/opt/openssl/
result with
curl version: 7.34.0
Host setup: i686-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
SSL support: no
(--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )
Post by Dan Fandrich
Post by Dung Nguyen
ok, i was trying build curl + ssl
at first i download curl src, open ssl src, put all in desktop
curl
curl/opt/openssl
i install openssl
./config
sudo make
sudo make install
trying to configure curl
./configure
[...]
Post by Dung Nguyen
okay but i found ssl support = no
so i read from here : http://curl.haxx.se/docs/install.html
and trying with
./configure --with-ssl
You'll likely have better luck using the PKG_CONFIG_PATH method mentioned just
after that section, or specifying the install location to the --with-ssl
option.
Post by Dung Nguyen
Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dan Fandrich
2014-01-08 08:10:15 UTC
Permalink
 env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl
 env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
also result in error
checking whether to enable iOS/Mac OS X native SSL/TLS... no
checking for pkg-config... /usr/bin/pkg-config
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto  "
configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib  "
configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include  "
These flags all look reasonable.
checking for CRYPTO_lock in -lcrypto... yes
This shows that it's finding the crypto library just fine.
checking for SSL_connect in -lssl... no
But not libssl. I suspect a problem with your OpenSSL build. You can look at
the config.log file for more details of what it's doing, and you can manually
check (with nm) for that symbol in your libssl.
checking for ssl with RSAglue/rsaref libs in use... checking for SSL_connect in
-lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where
specified!
./configure --with-ssl=/usr/local/ssl/lib
/configure --with-ssl=/opt/openssl/
result with 
  curl version:     7.34.0
  Host setup:       i686-pc-linux-gnu
  Install prefix:   /usr/local
  Compiler:         gcc
  SSL support:      no      (--with-
{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dung Nguyen
2014-01-10 10:39:38 UTC
Permalink
seem this file missing, i had try install libldap2-dev but still the error
exists :(
*configure:20482: result: no*
*configure:20495: checking for ldap_ssl.h*
*configure:20537: gcc -c -O2 -Wno-system-headers conftest.c >&5*
*conftest.c:72:22: fatal error: ldap_ssl.h: No such file or directory*
* #include <ldap_ssl.h>*
* ^*
Post by Dan Fandrich
Post by Dung Nguyen
env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl
env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
also result in error
checking whether to enable iOS/Mac OS X native SSL/TLS... no
checking for pkg-config... /usr/bin/pkg-config
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto "
configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib "
configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include "
These flags all look reasonable.
Post by Dung Nguyen
checking for CRYPTO_lock in -lcrypto... yes
This shows that it's finding the crypto library just fine.
Post by Dung Nguyen
checking for SSL_connect in -lssl... no
But not libssl. I suspect a problem with your OpenSSL build. You can look at
the config.log file for more details of what it's doing, and you can manually
check (with nm) for that symbol in your libssl.
Post by Dung Nguyen
checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in
Post by Dung Nguyen
-lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where
specified!
./configure --with-ssl=/usr/local/ssl/lib
/configure --with-ssl=/opt/openssl/
result with
curl version: 7.34.0
Host setup: i686-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
SSL support: no (--with-
{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dan Fandrich
2014-01-10 21:16:55 UTC
Permalink
Post by Dung Nguyen
seem this file missing, i had try install libldap2-dev but still the error
exists :(
configure:20482: result: no
configure:20495: checking for ldap_ssl.h
configure:20537: gcc -c -O2 -Wno-system-headers  conftest.c >&5
conftest.c:72:22: fatal error: ldap_ssl.h: No such file or directory
 #include <ldap_ssl.h>
                      ^
That's a red herring as it's in the LDAP check, not the OpenSSL
check. Here's the problem:

configure:21646: checking for SSL_connect in -lssl
configure:21668: gcc -o conftest -O2 -Wno-system-headers -I/usr/local/ssl/include -L/usr/local/ssl/lib
+conftest.c -lssl -lcrypto -lssl -lcrypto -llber -lldap -lz >&5
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x15): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x2b): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x35): undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x381): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x460): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x4e1): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x5c0): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x630): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x6a0): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x6df): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x788): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x7d9): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x834): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
configure:21668: $? = 1

For some reason, one of those libraries requires libdl and it's not
being pulled in. It would probably work if you specify LIBS=-ldl on your
configure command-line, but it would also be good to find out why it's needed.
My first guess was one of the LDAP libraries (which isn't using
pkg-config to find the dependencies) but the config log shows it's actually
OpenSSL. That means that its pkgconfig file is invalid if it's missing
that library. If you can confirm that, it would be good to report that problem
upstream.
Post by Dung Nguyen
 env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl
 env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
also result in error
checking whether to enable iOS/Mac OS X native SSL/TLS... no
checking for pkg-config... /usr/bin/pkg-config
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto  "
configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib  "
configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include  "
These flags all look reasonable.
checking for CRYPTO_lock in -lcrypto... yes
This shows that it's finding the crypto library just fine.
checking for SSL_connect in -lssl... no
But not libssl. I suspect a problem with your OpenSSL build. You can look at
the config.log file for more details of what it's doing, and you can manually
check (with nm) for that symbol in your libssl.
checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in
-lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where
specified!
./configure --with-ssl=/usr/local/ssl/lib
/configure --with-ssl=/opt/openssl/
result with 
  curl version:     7.34.0
  Host setup:       i686-pc-linux-gnu
  Install prefix:   /usr/local
  Compiler:         gcc
  SSL support:      no      (--with-
{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dung Nguyen
2014-01-11 14:30:40 UTC
Permalink
seem LIBS=-ldl working, i'll try pkg-config latter without OpenSSL
Post by Dan Fandrich
Post by Dung Nguyen
seem this file missing, i had try install libldap2-dev but still the
error
Post by Dung Nguyen
exists :(
configure:20482: result: no
configure:20495: checking for ldap_ssl.h
configure:20537: gcc -c -O2 -Wno-system-headers conftest.c >&5
conftest.c:72:22: fatal error: ldap_ssl.h: No such file or directory
#include <ldap_ssl.h>
^
That's a red herring as it's in the LDAP check, not the OpenSSL
configure:21646: checking for SSL_connect in -lssl
configure:21668: gcc -o conftest -O2 -Wno-system-headers
-I/usr/local/ssl/include -L/usr/local/ssl/lib
+conftest.c -lssl -lcrypto -lssl -lcrypto -llber -lldap -lz >&5
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function
dso_dlfcn.c:(.text+0x15): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x2b): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x35): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x381): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x460): undefined reference to `dlerror'
dso_dlfcn.c:(.text+0x4e1): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x5c0): undefined reference to `dlerror'
dso_dlfcn.c:(.text+0x630): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x6a0): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x6df): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function
dso_dlfcn.c:(.text+0x788): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x7d9): undefined reference to `dlerror'
dso_dlfcn.c:(.text+0x834): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
configure:21668: $? = 1
For some reason, one of those libraries requires libdl and it's not
being pulled in. It would probably work if you specify LIBS=-ldl on your
configure command-line, but it would also be good to find out why it's needed.
My first guess was one of the LDAP libraries (which isn't using
pkg-config to find the dependencies) but the config log shows it's actually
OpenSSL. That means that its pkgconfig file is invalid if it's missing
that library. If you can confirm that, it would be good to report that problem
upstream.
Post by Dung Nguyen
Post by Dung Nguyen
env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure
--with-ssl
Post by Dung Nguyen
Post by Dung Nguyen
env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure
--with-ssl
Post by Dung Nguyen
Post by Dung Nguyen
also result in error
checking whether to enable iOS/Mac OS X native SSL/TLS... no
checking for pkg-config... /usr/bin/pkg-config
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto "
configure: pkg-config: SSL_LDFLAGS: "-L/usr/local/ssl/lib "
configure: pkg-config: SSL_CPPFLAGS: "-I/usr/local/ssl/include "
These flags all look reasonable.
Post by Dung Nguyen
checking for CRYPTO_lock in -lcrypto... yes
This shows that it's finding the crypto library just fine.
Post by Dung Nguyen
checking for SSL_connect in -lssl... no
But not libssl. I suspect a problem with your OpenSSL build. You can
look
Post by Dung Nguyen
at
the config.log file for more details of what it's doing, and you can manually
check (with nm) for that symbol in your libssl.
Post by Dung Nguyen
checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in
Post by Dung Nguyen
-lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found
where
Post by Dung Nguyen
Post by Dung Nguyen
specified!
./configure --with-ssl=/usr/local/ssl/lib
/configure --with-ssl=/opt/openssl/
result with
curl version: 7.34.0
Host setup: i686-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
SSL support: no (--with-
{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Continue reading on narkive:
Loading...