Closed TheHellTower closed 1 month ago
I for some reasons even have this issue with very minimal example:
#include <iostream>
#include <cpr/cpr.h>
int main()
{
cpr::Response response = cpr::Get(cpr::Url{ "https://example.com" });
std::cout << response.text << std::endl;
}
Is the vcpkg
package broken ? Reinstall it didn't really help..
- vcpkg remove cpr:x64-windows --recurse
- vcpkg install cpr:x64-windows
@TheHellTower thanks for reporting. To me this looks like a vcpkg/msvc issue?
I tested it on Linux using gcc 14.1.1
where everything worked except the import std;
(need to wait for gcc 15 for that :) ).
Clang had other include related issues.
Here is my code: https://github.com/libcpr/example-cmake-fetch-content/tree/feature/cpr_module
@TheHellTower thanks for reporting. To me this looks like a vcpkg/msvc issue? I tested it on Linux using
gcc 14.1.1
where everything worked except theimport std;
(need to wait for gcc 15 for that :) ). Clang had other include related issues.Here is my code: https://github.com/libcpr/example-cmake-fetch-content/tree/feature/cpr_module
Hello, yes I'm using Visual Studio and the MSVC compiler, but I never got this issue before it happened after I completelly replace vcpkg
.. Do you have any idea ? Because even the very simple example with only a simple GET request in the main
function fail.. Do I need to open an issue on the vcpkg repository and mention this issue ?
Sorry there I can not help you. From the cpr side of things everything looks to be working at least on Linux.
Since I recognize the location your error is showing up, it could be a missing linker directive.
I'm not sure what needs to be done to link against this missing function on Windows since I suspect it should be part of #include <mutex>
also on Windows.
https://github.com/microsoft/STL/blob/main/stl/src/sharedmutex.cpp
Sorry there I can not help you. From the cpr side of things everything looks to be working at least on Linux.
Since I recognize the location your error is showing up, it could be a missing linker directive.
I'm not sure what needs to be done to link against this missing function on Windows since I suspect it should be part of
#include <mutex>
also on Windows.https://github.com/microsoft/STL/blob/main/stl/src/sharedmutex.cpp
Yeah I found this definition only in STL repository and so I wasn't sure how it was part of cpr.. Sadly even with this include the same error happens.. I will open an issue on the vcpkg
repository to see if they have an idea about the issue, thanks !
So I seen on the readme that CPR got a NuGet package and:
NuGet Package: Compile
VCPKG Build: LNK2001 unresolved external symbol _Cnd_timedwait_for
So I think the it can be a VCPKG issue 🤔
Closing this one since it does not look to be a cpr issue.
Description
Whenever I use cpr into my
ixx
module I just get anLNK2001 unresolved external symbol _Cnd_timedwait_for
and can't build my project.When I comment the
return
lines insendRequest
it compiles.. But I need the response..Example/How to Reproduce
Create an
ixx
(C++20) Module with the following code:Possible Fix
No response
Where did you get it from?
vcpkg
Additional Context/Your Environment