libcurlを使ってC++プログラムにWebソースを読み込ませたいのですが、 "curl.h"というファイルを開くことはできません。あなたはカールソースを含めましたと仮定すると、カールライブラリは独立して、あなたはおそらく、二重引用符を探しているインストールされている場所で、ヘッダーを検索するために、コンパイラに指示してきた場合を除きlibcurlをC++プロジェクトにインポートするには?
0
A
答えて
1
。それ以外の場合は、プロジェクト設定でパスをインクルードする必要があります。
What is the difference between #include <filename> and #include "filename"?
違いは、プリプロセッサが含まれるファイルを検索する場所です。
#include "filename"の場合、プリプロセッサはディレクティブを含むファイルと同じディレクトリで検索し、#includeのようにします。このメソッドは通常、プログラマー定義のヘッダーファイルを含めるために使用されます。
#includeの場合、ファイル名>プリプロセッサは、通常、コンパイラ/ IDEによってあらかじめ指定された検索ディレクトリ内で、実装に依存した方法で検索します。このメソッドは通常、標準ライブラリヘッダーファイルをインクルードするために使用されます。
0
In short,
Add the path of the libcurl's include folder in C/C++ -? General -> Additional include directories. This way the Visual Studio will get to know the location of curl.h
In Detail:
Using libcurl involves 2 steps:
1. Download and build libcurl on your platform.
2. Plug-it in your C\C++ application
Step 1:
Download code from https://curl.haxx.se/download.html and unzip the zip file in a folder. I guess you already have done it.
cd curl-src\winbuild
nmake /f Makefile.vc mode=<static or dll> <options>
VC=<6,7,8,9,10,11,12,14> - VC versions
WITH_DEVEL=<path> - Paths for the development files (SSL, zlib, etc.)
Defaults to sibbling directory deps: ../deps
Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/
Uncompress them into the deps folder.
WITH_SSL=<dll or static> - Enable OpenSSL support, DLL or static
WITH_MBEDTLS=<dll or static> - Enable mbedTLS support, DLL or static
WITH_CARES=<dll or static> - Enable c-ares support, DLL or static
WITH_ZLIB=<dll or static> - Enable zlib support, DLL or static
WITH_SSH2=<dll or static> - Enable libSSH2 support, DLL or static
ENABLE_SSPI=<yes or no> - Enable SSPI support, defaults to yes
ENABLE_IPV6=<yes or no> - Enable IPv6, defaults to yes
ENABLE_IDN=<yes or no> - Enable use of Windows IDN APIs, defaults to yes
Requires Windows Vista or later, or installation from:
https://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815
ENABLE_WINSSL=<yes or no> - Enable native Windows SSL support, defaults to yes
GEN_PDB=<yes or no> - Generate Program Database (debug symbols for release build)
DEBUG=<yes or no> - Debug builds
MACHINE=<x86 or x64> - Target architecture (default is x86)
For More info, you can read INSTALL file present in the downloaded zip.
Step 2: Once you have the library built, plug-it in you application as:
a) Right Click the VS project in which you want to add the dependency of curl and select properties.
b) Add the path of the libcurl's include folder in C/C++ -> General -> Additional include directories. This way the Visual Studio will get to know the location of curl.h
c) Add the path of libcurl library in linker -> General -> Additional Library Directories.
d) Mention libcurl name in Linker -> input -> Additional Dependencies.
You are good to go !
Note: if you are using dll for curl, then this dll should be present in the same directory in which your .exe for the application is present.
関連する問題
- 1. Cメソッド/クラスをC#プロジェクトにインポートする
- 2. EclipseにC++プロジェクトをインポートする
- 3. C++プロジェクト(IDE:Eclipse)にC/C++ライブラリ(libcurlなど)を含めるにはどうすればいいですか?
- 4. C++ライブラリをXcode Objective Cプロジェクトにインポートする方法は?
- 5. C#WPFプロジェクトにインポートされたサウンドを再生するには?
- 6. プログラムでC/C++プロジェクトをインポートする
- 7. C#プロジェクトのC++ dllをインポートする
- 8. 外部ライブラリとプロジェクトをC++プロジェクトにGUIを使ってインポートするには?
- 9. LibCURL C++を使用する
- 10. Intellij IDEにプロジェクトをインポートするには?
- 11. xcodeプロジェクトにWebRTCをインポートするには?
- 12. vb.netプロジェクトをvb.netプロジェクトにインポートする
- 13. Xcodeプロジェクトを別のプロジェクトにインポートする
- 14. XcodeでC++プロジェクトをインポートする
- 15. akkaプロジェクトでdocs。*をインポートするには?
- 16. eclipseでMavenプロジェクトをインポートするには?
- 17. EclipseプロジェクトでOpenAdaptorをインポートするには?
- 18. libcurlでのメモリアクセスエラーC++
- 19. C++ライブラリにはLibCurlが必要です - アプリケーションのユーザーにはlibcurlが必要ですか?
- 20. C++:libcurlとストリームを使用する
- 21. C関数をCヘッダに宣言されていないC++プロジェクトにインポートするには?
- 22. libcurl HTTP webrequestを作成するには?
- 23. libcurlをC++でポストすると、コールバックパラメータが不要になる
- 24. C++ LibCurl - CStringコードをCStringに変換する
- 25. Eclipseにプロジェクトをインポートすると、Androidプロジェクトのみがインポートされます
- 26. は、EclipseのJavaプロジェクトにDLLをインポートするにはEclipseのJavaプロジェクト
- 27. HtmlUnitをAndroidプロジェクトにインポートする
- 28. プロジェクトに外部SQLiteデータベースをインポートする
- 29. GitプロジェクトをEclipse Workspaceにインポートする
- 30. プロジェクトをeclipseにインポートする方法
ビジュアルスタジオを使用していますか? – user3808887
https://curl.haxx.se/libcurl/c/libcurl-tutorial.html、特に「プログラムのコンパイル」を参照してください。 – racraman