9
votes

Comment résoudre ces erreurs de liaison libcurl?

*** Warning: linker path does not have real file for library -lssl.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libssl and none of the candidates passed a file format test
*** using a file magic. Last file checked: /ssl/lib/libssl.a

*** Warning: linker path does not have real file for library -lcrypto.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libcrypto and none of the candidates passed a file format test
*** using a file magic. Last file checked: /ssl/lib/libcrypto.a

*** Warning: linker path does not have real file for library -lz.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libz and none of the candidates passed a file format test
*** using a file magic. Last file checked: /mingw/lib//libz.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.

0 commentaires

4 Réponses :


7
votes

libtool a construit uniquement une libcurl statique et non une bibliothèque dynamique. Vos en-têtes recherchent une libcurl dynamique. Ce n'est probablement pas la faute de libcurl, car je peux voir le code dans les en-têtes prenant en charge __ declSpec (dllimport) et __ declSpec (dllexport) (c'est un bon signe que l'auteur de package sait ce que .

Détails techniques: Voir cette réponse concernant la libsssh .

solution: compiler avec -DCurl_staticlib .


2 commentaires

Hm. Je pensais que libcurl construit à la fois statique et dynamique. J'ai essayé -dcurl_staticlib, mais maintenant, je reçois des centaines d'erreurs de liaison disent une référence non définie à Wsastartup @ 8, _IMP__Arees_library_init, NTOHS @ 4, Getockopt @ 20 etc.


Vous ne reliez dans aucune des bibliothèques dépendantes. Vous aurez besoin (au moins) -LWINSOCK2` plus quels que soient les drapeaux -l pour les autres bibliothèques (il ressemble à OpenSSL et éventuellement un ou deux autres).



8
votes

J'ai pu éviter ces erreurs de liaison de boucle sur Windows (Mingw Win32) en ajoutant l'option -LCurl.dll . -dcurl_staticlib n'était pas nécessaire dans mon cas.

My Build a deux fichiers libcurl dans dossier Mingw / Lib: libcurl.a et libcurl.dll.a


1 commentaires

Merci pour le BridgeMumbe qui résout mon problème G ++: Code :: Blocs> Paramètres> Compilateur> Paramètres de liaison> Ajouter> libcurldll.a && libcurlll.a



1
votes

Avoir le même problème à l'aide de Netbeans 7.1 avec Mingw. Des propriétés, Linker Ajouter une bibliothèque libcurl.dll.a a résolu le problème pour moi.

Ce fichier était situé sous CURL-7.28.1 \ Lib.Libs après avoir couru le MINGW.


0 commentaires

0
votes

J'ai eu une erreur similaire (avec libz et libsqlite) dans différents projets. Il est produit par script GNU libtool.

La raison dans mon cas n'était pas du manque de fichiers pour ces bibliothèques (.la?) ou peut-être des variantes libz.dll.a des bibliothèques.

Pour avoir tous les fichiers nécessaires à la construction de Automake / AutoConf ./ configure --prefix = ...;; faire , vous devrez créer zlib , crypto et ssl avec configure et Faites sous le même message. CULAKE ou CUSTURE MAKEFILE Builds ne fonctionnera généralement pas comme des dépendances de Bibliothèque partagée.

Une autre et l'option la plus simple consiste à construire une boucle dynamique avec cmake ( https://github.com/ BASTER / CURL.GIT )


0 commentaires