久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <small id='BECQz'></small><noframes id='BECQz'>

    <legend id='BECQz'><style id='BECQz'><dir id='BECQz'><q id='BECQz'></q></dir></style></legend>
  1. <i id='BECQz'><tr id='BECQz'><dt id='BECQz'><q id='BECQz'><span id='BECQz'><b id='BECQz'><form id='BECQz'><ins id='BECQz'></ins><ul id='BECQz'></ul><sub id='BECQz'></sub></form><legend id='BECQz'></legend><bdo id='BECQz'><pre id='BECQz'><center id='BECQz'></center></pre></bdo></b><th id='BECQz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BECQz'><tfoot id='BECQz'></tfoot><dl id='BECQz'><fieldset id='BECQz'></fieldset></dl></div>

    • <bdo id='BECQz'></bdo><ul id='BECQz'></ul>
      <tfoot id='BECQz'></tfoot>

      使 cURL 與 Visual Studios 2017 一起使用

      Getting cURL to work with Visual Studios 2017(使 cURL 與 Visual Studios 2017 一起使用)
        <i id='dQDio'><tr id='dQDio'><dt id='dQDio'><q id='dQDio'><span id='dQDio'><b id='dQDio'><form id='dQDio'><ins id='dQDio'></ins><ul id='dQDio'></ul><sub id='dQDio'></sub></form><legend id='dQDio'></legend><bdo id='dQDio'><pre id='dQDio'><center id='dQDio'></center></pre></bdo></b><th id='dQDio'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dQDio'><tfoot id='dQDio'></tfoot><dl id='dQDio'><fieldset id='dQDio'></fieldset></dl></div>
            <tbody id='dQDio'></tbody>
          <legend id='dQDio'><style id='dQDio'><dir id='dQDio'><q id='dQDio'></q></dir></style></legend><tfoot id='dQDio'></tfoot>
              <bdo id='dQDio'></bdo><ul id='dQDio'></ul>

              • <small id='dQDio'></small><noframes id='dQDio'>

              • 本文介紹了使 cURL 與 Visual Studios 2017 一起使用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                *按照以下步驟,我在 VS 2017 上的 VS 2017 中按照以下步驟運行了 CURL(原始問題見下文):

                首先安裝 vcpkg:

                1. 使用 gitbash 將 vcpkg 克隆到 C:Program Files
                2. 在命令提示符中導航到 C:Program Filesvcpkg
                3. 在命令提示符下運行:.ootstrap-vcpkg.bat
                4. 在命令提示符下運行:vcpkg集成安裝

                然后使用 vcpkg 和 Visual Studios 2017 命令提示符安裝 cURL:

                1. 打開 VS 2017 命令提示符 并導航到 vcpkg 文件夾(vcpkg.exe 所在的位置)
                2. 運行:vcpkg install curl[*]:x64-windows(注意這可能需要大約半小時來下載和運行,如果它看起來像卡在零件上).

                  *以前我的指令說要運行 vcpkg install curl:x64-windows 但我在@i7clock 的要求下添加了 [*] 以啟用 sftp和 scp 協議.

                3. 在這一步之后,您應該檢查以確保 curl 安裝正確.為此,您應該在 VS 2017 中創建一個新項目并嘗試包含 #include curl/curl.h 而不添加任何其他包含目錄.如果您不能這樣做,那么您的 curl 安裝就會出現問題.您應該刪除 curl(甚至可能刪除 vcpkg 文件夾并進行全新安裝),直到您可以包含 curl/curl.h.

                  *重要提示:這僅在您使用 x64 調試器/在 x64 中編譯時有效!如果您無法包含 curl 目錄,請檢查以確保您的調試設置為正確的 Windows 版本.

                您可能還需要禁用 SSL 對等驗證:

                1. 將代碼 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE); 放在請求之前(見下文).請注意,這只是必要的,因為我無法弄清楚如何獲取證書以使用 curl.我有一個關于這個問題的迄今為止尚未回答的 stackoverflow 帖子 這里.

                這里有一些其他步驟,您可能需要嘗試讓事情運行,但我最終發現它們沒有必要:

                1. 導航到 vcpkgpackagescurl_x64-windowslib 以找到 libcurl.lib 文件.
                2. 在屬性 -> 鏈接器下的附加庫目錄中包含 libcurl.lib 的路徑
                3. 在鏈接器下的附加依賴項中包含 libcurl.lib -> 輸入 -> 附加依賴項
                4. CURL_STATICLIB 放在屬性 -> C/C++ -> 預處理器 -> 預處理器定義中

                這是我現在的工作代碼:

                #include "curl/curl.h"無效測試卷曲(){卷曲 *卷曲;CURLcode res;curl_global_init(CURL_GLOBAL_ALL);curl = curl_easy_init();如果(卷曲){curl_easy_setopt(卷曲,CURLOPT_SSL_VERIFYPEER,FALSE);curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");#ifdef SKIP_PEER_VERIFICATIONcurl_easy_setopt(卷曲,CURLOPT_SSL_VERIFYPEER,0L);#萬一#ifdef SKIP_HOSTNAME_VERIFICATIONcurl_easy_setopt(卷曲,CURLOPT_SSL_VERIFYHOST,0L);#萬一res = curl_easy_perform(curl);如果 (res != CURLE_OK)fprintf(stderr, "curl_easy_perform() 失敗:%s
                ",curl_easy_strerror(res));curl_easy_cleanup(卷曲);}curl_global_cleanup();}int main(){測試卷曲();返回0;}

                *這是我的舊問題在修復之前的其余解釋:

                我正在嘗試使用 cURL 進行 API 調用,以便我可以開始獲取實時股票數據,但我在 VS 2017 中遇到了困難.我嘗試了

                解決方案

                您已經使用 vcpkg 安裝了 x86 版本的 curl(即 vcpkgpackagescurl_x86include 中的 x86).您需要安裝 x64 版本以匹配您的項目:

                >vcpkg install curl:x64-windows

                *Edit: I got CURL working in VS 2017 on a 64 bit machine following these steps (see below for original problem):

                First install vcpkg:

                1. Clone vcpkg using gitbash into C:Program Files
                2. In a command prompt navigate to C:Program Filesvcpkg
                3. Run in the command prompt: .ootstrap-vcpkg.bat
                4. Run in the command prompt: vcpkg integrate install

                Then use vcpkg and Visual Studios 2017 command prompt to install cURL:

                1. Open a VS 2017 Command prompt and navigate to the vcpkg folder (where the vcpkg.exe is)
                2. Run: vcpkg install curl[*]:x64-windows (note this can take around a half hour to download and run, don't worry if it looks like it is "stuck" at parts).

                  *Edit: previously my instructions said to run vcpkg install curl:x64-windows but I added on the [*] at the behest of @i7clock to enable sftp and scp protocols.

                3. After this step, you should check to make sure that curl installed correctly. To do this you should create a new project in VS 2017 and try and include #include curl/curl.h without adding any additional include directories. If you cannot do this then something went wrong with your install of curl. You should remove curl (and perhaps even the vcpkg folder and do a clean install) until you can include curl/curl.h.

                  *Important Note: this will only work if you are using x64 debugger/compiling in x64! If you cannot include the curl directory check to make sure your debug is set to the correct version of Windows.

                You may need to disable SSL peer verification as well:

                1. Place the code curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE); before the request (see below). Note this is only necessary because I could not figure how to get certificates to work with curl. I have an as-of-yet unanswered stackoverflow post regarding this problem here.

                Here are some other steps you may need to try to get things running, but I ended up finding them not necessary:

                1. Navigate to vcpkgpackagescurl_x64-windowslib to find the libcurl.lib file.
                2. Include the path to libcurl.lib in Additional Library Directories under Properties -> Linker
                3. Included libcurl.lib in Additional Dependencies under Linker -> Input -> Additional Dependencies
                4. Place CURL_STATICLIB in Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions

                Here is my now working code:

                #include "curl/curl.h"
                
                
                void testCurl() {
                    CURL *curl;
                    CURLcode res; 
                
                    curl_global_init(CURL_GLOBAL_ALL); 
                
                    curl = curl_easy_init();
                    if (curl) {
                      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
                      curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
                
                    #ifdef SKIP_PEER_VERIFICATION
                        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
                    #endif
                
                    #ifdef SKIP_HOSTNAME_VERIFICATION
                        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
                    #endif
                
                    res = curl_easy_perform(curl);
                
                   if (res != CURLE_OK)
                       fprintf(stderr, "curl_easy_perform() failed: %s
                ",
                       curl_easy_strerror(res));
                
                       curl_easy_cleanup(curl);
                 }
                 curl_global_cleanup();
                }
                
                int main(){
                    testCurl();
                    return 0;
                }
                

                *Edit: Here is the rest of the explanation of my old problem before it was fixed:

                I am trying to use cURL to make an API call so I can start getting real time stock data, but I am running into difficulties getting it to function in VS 2017. I have attempted an install using vcpckg using the following steps:

                According to vcpkg documentation I should be able to now simply #include , but it can't find the folder. If I try including the "include" directory from vcpkgpackagescurl_x86include and #include I can build my project. I can also access some of the classes, but if I try and set the curl_global_init(CURL_GLOBAL_DEFAULT) as in this example I get linker errors.

                解決方案

                You've installed the x86 version of curl with vcpkg (That's the x86 in vcpkgpackagescurl_x86include). You need to install the x64 version to match your project:

                >vcpkg install curl:x64-windows

                這篇關于使 cURL 與 Visual Studios 2017 一起使用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                Scope of exception object in C++(C++中異常對象的范圍)
                Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)

                • <bdo id='lVSJ9'></bdo><ul id='lVSJ9'></ul>
                    <i id='lVSJ9'><tr id='lVSJ9'><dt id='lVSJ9'><q id='lVSJ9'><span id='lVSJ9'><b id='lVSJ9'><form id='lVSJ9'><ins id='lVSJ9'></ins><ul id='lVSJ9'></ul><sub id='lVSJ9'></sub></form><legend id='lVSJ9'></legend><bdo id='lVSJ9'><pre id='lVSJ9'><center id='lVSJ9'></center></pre></bdo></b><th id='lVSJ9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lVSJ9'><tfoot id='lVSJ9'></tfoot><dl id='lVSJ9'><fieldset id='lVSJ9'></fieldset></dl></div>

                    <tfoot id='lVSJ9'></tfoot>

                    <legend id='lVSJ9'><style id='lVSJ9'><dir id='lVSJ9'><q id='lVSJ9'></q></dir></style></legend>

                          <tbody id='lVSJ9'></tbody>

                        <small id='lVSJ9'></small><noframes id='lVSJ9'>

                        1. 主站蜘蛛池模板: 久久中文网 | 欧美精品一二三 | 国产成人精品999在线观看 | 97国产精品 | 成年视频在线观看 | 午夜成人免费视频 | av一区二区三区四区 | 午夜久久久 | 国产ts人妖系列高潮 | 欧美一区2区三区4区公司二百 | 国产极品车模吞精高潮呻吟 | 色偷偷888欧美精品久久久 | 欧洲色综合 | 久久精品国产99国产精品亚洲 | av在线伊人 | 欧美日韩精品中文字幕 | 国产一区二区三区www | 国产一区二区三区色淫影院 | 成人网在线 | 国产精品久久久久久久久图文区 | 在线一区观看 | 日日干日日操 | 精品乱码一区二区 | 国产乱码精品1区2区3区 | 一级a性色生活片久久毛片 午夜精品在线观看 | 欧美精品在线免费 | 免费成人在线网站 | 97精品久久 | 伊人久久伊人 | 91免费在线播放 | 免费观看黄网站 | 午夜精品久久久久久久99黑人 | 国产欧美精品一区二区 | 午夜www| 草草视频在线观看 | 亚洲视频免费 | 国产中文字幕在线 | 亚洲精品1区 | 亚洲一av | 国产精品一区二区不卡 | 夜夜艹 |