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

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

  1. <tfoot id='BdHWY'></tfoot>

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

      使 LibCurl 与 Visual Studio 2013 一起使用

      Getting LibCurl to work with Visual Studio 2013(使 LibCurl 与 Visual Studio 2013 一起使用)
      <legend id='E6AXT'><style id='E6AXT'><dir id='E6AXT'><q id='E6AXT'></q></dir></style></legend>

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

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

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

                  <tbody id='E6AXT'></tbody>
                本文介绍了使 LibCurl 与 Visual Studio 2013 一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在让 LibCurl 与 Visual Studio 2013 一起工作时遇到问题.我下载了当前版本 (curl-7.33.0) 并尝试按照我在本网站上找到的说明进行操作:添加 libcurl 库并成功编译后,我现在收到此错误消息:

                 应用程序无法正确启动 (0xc000007b).单击确定关闭应用程序.

                这是我尝试运行的示例代码:

                #include #include #include int main(void){卷曲 *卷曲;CURLcode res;curl = curl_easy_init();如果(卷曲){curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");res = curl_easy_perform(curl);/* 总是清理 */curl_easy_cleanup(卷曲);}返回0;}

                <小时>

                最终更新

                我相信我现在已经让 LibCurl 与 Visual Studio 2013 一起工作了.坚持ftw!虽然,在花了几个小时试图解决这些错误消息之后,我还是有点犹豫现在一切正常.这就是为什么我在这个问题上悬赏以获取关于让 LibCurl 与 Visual Studio 2013 一起使用的清晰简洁说明.

                这是我为了让它工作而做的:

                1. 首先,在此处下载 Win32 MSVC 包:http://curl.haxx.se/download.html#Win32为了这些说明,假设您下载到 C:LibCurl

                2. 在 Visual Studio 中启动一个新项目.转到项目|项目属性|VC++ 目录|包含目录|将路径添加到下载的包内的包含目录中.(C:LibCurlinclude)

                3. 接下来,转到项目|项目属性|链接器|常规|附加库目录|添加lib目录的路径.(curllib.dll 所在的位置)

                4. 然后,转到项目|项目属性|链接器|输入|其他依赖项|并添加 curllib.lib

                5. 现在,如果您编译测试程序,您可能会收到消息,指出缺少 libsasl.dll.您需要下载此文件并将其放在与构建相同的目录中.我使用 7-Zip 从 OpenLDAP for Windows 中提取 libsasl.dll.Windows 版 OpenLDAP

                这是我上面的测试代码的结果:

                解决方案

                我会在评论中说,但我缺乏要点.您不必将任何 .dll 复制到您的程序运行目录中.转到项目|属性 |配置属性并在环境中写入:PATH=$(ExecutablePath)$(LocalDebuggerEnvironment).

                从现在开始,您在项目|项目属性|VC++ 目录|二进制中提到的任何目录中的所有 .dll 都应该可以使用而无需复制.

                其余的和你写的完全一样.

                I am having trouble getting LibCurl to work with Visual Studio 2013. I downloaded the current version (curl-7.33.0) and tried following the instructions I found on this site: Using LibCurl with Visual 2010

                But I can't find curllib.lib in the folder I downloaded. And I am still getting errors:

                After searching the internet for more help. I now get these error messages. There appears to be a problem with linking to libcurl.lib?

                This is what I have configured:


                Inside /lib I have libcurl.lib and libcurl.dll


                UPDATE

                I downloaded this release for Win32 MSVC: http://curl.haxx.se/download.html#Win32 After adding the libcurl libraries and successfully compiling, I am now getting this error message:

                 The application was unable to start correctly (0xc000007b). Click OK to close the application.
                

                Here is the sample code I am trying to run:

                #include <iostream>
                #include <stdio.h> 
                #include <curl/curl.h> 
                
                
                int main(void)
                {
                    CURL *curl;
                    CURLcode res;
                
                    curl = curl_easy_init();
                    if (curl) {
                        curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
                        res = curl_easy_perform(curl);
                
                        /* always cleanup */
                        curl_easy_cleanup(curl);
                    }
                    return 0;
                }
                


                FINAL UPDATE

                I believe I have gotten LibCurl to work with Visual Studio 2013 now. Persistence ftw! Although, after spending hours trying to solve these error messages, I am a little hesitant at saying everything is working fine now. That is why I am putting a bounty on this question to get clear and concise instructions on getting LibCurl to work with Visual Studio 2013.

                This is what I did to get it to work:

                1. First, download the Win32 MSVC package here: http://curl.haxx.se/download.html#Win32 For these instructions sake, let's say you downloaded to C:LibCurl

                2. Start a new project in Visual Studio. Go to Project|Project Properties|VC++ Directories|Include Directories| Add the path to the include directory inside the downloaded package. (C:LibCurlinclude)

                3. Next, go to Project|Project Properties|Linker|General|Additional Library Directories| Add the path to the lib directory. (Where curllib.dll is located)

                4. Then, go to Project|Project Properties|Linker|Input|Additional Dependencies| And add curllib.lib

                5. Now if you compile a test program, you will likely get the message saying libsasl.dll is missing. You will need to download this file and put it in the same directory as your build. I used 7-Zip to extract libsasl.dll from OpenLDAP for Windows. OpenLDAP for Windows

                This is the result of my test code from above:

                解决方案

                I would say that in a comment, but I am lacking in points. You don't have to copy any .dll into your program run catalog. Go to Project | Properties | Configuration Properties and in line Envrionment write: PATH=$(ExecutablePath)$(LocalDebuggerEnvironment).

                From now on, all .dlls from any catalog you mention in Project|Project Properties|VC++ Directories|Binary should be usable without copying them.

                The rest is exactly as you written.

                这篇关于使 LibCurl 与 Visual Studio 2013 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)
                1. <i id='i8w7A'><tr id='i8w7A'><dt id='i8w7A'><q id='i8w7A'><span id='i8w7A'><b id='i8w7A'><form id='i8w7A'><ins id='i8w7A'></ins><ul id='i8w7A'></ul><sub id='i8w7A'></sub></form><legend id='i8w7A'></legend><bdo id='i8w7A'><pre id='i8w7A'><center id='i8w7A'></center></pre></bdo></b><th id='i8w7A'></th></span></q></dt></tr></i><div id='i8w7A'><tfoot id='i8w7A'></tfoot><dl id='i8w7A'><fieldset id='i8w7A'></fieldset></dl></div>
                2. <tfoot id='i8w7A'></tfoot>
                    <tbody id='i8w7A'></tbody>
                    • <small id='i8w7A'></small><noframes id='i8w7A'>

                      <legend id='i8w7A'><style id='i8w7A'><dir id='i8w7A'><q id='i8w7A'></q></dir></style></legend>
                        • <bdo id='i8w7A'></bdo><ul id='i8w7A'></ul>