Question

ma première question ici:

Je ne parviens pas à l'aide libcURL dans un projet C ++. Je ne même pas l'obtenir LIÉ. J'utilise Windows XP et Visual C ++ 2008 Express Edition.

Voici donc ce que je faisais:

  1. Téléchargé libcURL: curl-7.19.5-devel-mingw32.zip
  2. Ouvert nouveau projet dans VC ++ commandline
  3. Inclure les dossiers de lib 'et « inclure » à mon nouveau projet (peut-être trivial, mais m'a pris un certain temps; -)
  4. dans Propriétés-> C / C ++ -> Général: dossier ajouté 'include' à 'autres dossiers à inclure'
  5. dans Propriétés-> Linker-> Général: dossier Ajouté 'lib' à 'autres dossiers avec des bibliothèques'
  6. dans Propriétés-> Linker-> Entrée: Ajout de dépendances supplémentaires: libcurl.a libcrypto.a libeay32.a libidn.a libssh2.a libssh2dll.a libssl32.a libssl.a libz.a libzdll.a Ws2_32.lib WLDAP32 .lib
  7. dans Propriétés-> C / C ++ -> préprocesseur: définition ajoutée 'CURL_STATICLIB'
  8. J'unChecked 'têtes précompilés' et assuré 'multithread-DLL (/ MD)' est utilisé

Je copié le simple.c (exemple de http: / /curl.haxx.se/lxr/source/docs/examples/simple.c ) dans mon dossier de projet principal. Quand je tente de compiler je reçois la sortie suivante:

Neues Erstellen gestartet: Projekt: curl_project, Konfiguration: Debug Win32
Die Zwischen- und Ausgabedateien für das Projekt "curl_project" mit der Konfiguration "Debug|Win32" werden gelöscht.
Kompilieren...
stdafx.cpp
Kompilieren...
curl_project.cpp
Manifest in Ressourcen wird kompiliert...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Verknüpfen...
libcurl.a(ftp.o) : error LNK2001: Nicht aufgelöstes externes Symbol "_strtoll".
libcurl.a(file.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_strtoll" in Funktion "_file_do".
libcurl.a(cookie.o) : error LNK2001: Nicht aufgelöstes externes Symbol "_strtoll".
libcurl.a(transfer.o) : error LNK2001: Nicht aufgelöstes externes Symbol "_strtoll".
libcurl.a(ssh.o) : error LNK2001: Nicht aufgelöstes externes Symbol "_strtoll".
libcurl.a(http.o) : error LNK2001: Nicht aufgelöstes externes Symbol "_strtoll".
libcurl.a(mprintf.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "___umoddi3" in Funktion "_dprintf_formatf".
libcrypto.a(b_print.o) : error LNK2001: Nicht aufgelöstes externes Symbol "___umoddi3".
libcrypto.a(bn_word.o) : error LNK2001: Nicht aufgelöstes externes Symbol "___umoddi3".
libcurl.a(mprintf.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "___udivdi3" in Funktion "_dprintf_formatf".
libcrypto.a(b_print.o) : error LNK2001: Nicht aufgelöstes externes Symbol "___udivdi3".
libcrypto.a(e_atalla.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcrypto.a(eng_padlock.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__alloca" in Funktion "_ENGINE_load_padlock".
libcrypto.a(sha512.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcrypto.a(bn_prime.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcurl.a(mprintf.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcurl.a(formdata.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcrypto.a(err_prn.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcrypto.a(cryptlib.o) : error LNK2001: Nicht aufgelöstes externes Symbol "__alloca".
libcurl.a(progress.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "___divdi3" in Funktion "_time2str".
libssh2.a(scp.o) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_snprintf" in Funktion "_libssh2_scp_send_ex".
C:\Dokumente und Einstellungen\Punkx\Eigene Dateien\Visual Studio 2008\Projects\curl_project\Debug\curl_project.exe : fatal error LNK1120: 6 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter "file://c:\Dokumente und Einstellungen\Punkx\Eigene Dateien\Visual Studio 2008\Projects\curl_project\curl_project\Debug\BuildLog.htm" gespeichert.
curl_project - 22 Fehler, 0 Warnung(en)
========== Alles neu erstellen: 0 erfolgreich, Fehler bei 1, 0 übersprungen ==========

Quelqu'un peut-il voir, ce que j'ai oublié ou si le problème est? Je suis C du débutant, il pourrait être quelque chose trival ... Thx pour l'aide!

Était-ce utile?

La solution

Vous utilisez des bibliothèques MinGW avec le compilateur Visual C ++. Utilisez le paquet binaire correct et / ou construire vous-même.

Si vous utilisez Visual C ++, vous ne devriez pas traiter .a fichiers, mais seulement avec .lib.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top