libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.49k stars 924 forks source link

How to fix error (Process finished with exit code -1073741515 (0xC0000135))? #905

Closed FOUREX closed 1 year ago

FOUREX commented 1 year ago

Description

Error after process running.

Example/How to Reproduce

Code:

#include <iostream>
#include <cpr/cpr.h>

int main() {
    cpr::Response r;
    r = cpr::Get(cpr::Url{"http://localhost:25565"});

    std::cout << r.status_code;

    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.24)
project(duck)

set(CMAKE_CXX_STANDARD 23)
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
                     GIT_TAG 32fd1453194c37d5136577ee55629b863a42333f)
FETCHCONTENT_MAKEAVAILABLE(cpr)

add_executable(duck main.cpp)
target_link_libraries(duck PRIVATE cpr::cpr)

No problems while building project. Problem after program executed (try not works):

Process finished with exit code -1073741515 (0xC0000135)

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

COM8 commented 1 year ago

@FOUREX Thanks for reporting and the well structured report!

It looks like you are running an outdated 1.10.x release. Could you please retry with a more recent commit from here: https://github.com/libcpr/cpr/commits/1.10.x

I also can not reproduce this behaviour with your code, or the example provided here: https://github.com/libcpr/example-cmake-fetch-content

FOUREX commented 1 year ago

@FOUREX Thanks for reporting and the well structured report!

It looks like you are running an outdated 1.10.x release. Could you please retry with a more recent commit from here: https://github.com/libcpr/cpr/commits/1.10.x

I also can not reproduce this behaviour with your code, or the example provided here: https://github.com/libcpr/example-cmake-fetch-content

I copied libcpr.dll and libcurl-d.dll, it works!