-
Notifications
You must be signed in to change notification settings - Fork 6.9k
CPR Port | unresolved external symbol _Cnd_timedwait_for
#39829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using the latest version of vcpkg for local installation does not reproduce the issue. Could you please try these codes? command that cmake -Bbuild_dir -DCMAKE_BUILD_TYPE=Debug -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=%your_vcpkg_dir%/scripts/buildsystems/vcpkg.cmake
cmake --build build_dir --config Debug main.cpp #include "cpr/cpr.h"
#include <iostream>
int main() {
std::cout << "cpr" << std::endl;
cpr::Get(
cpr::Url{ "https://api.github.com/repos/whoshuu/cpr/contributors" },
cpr::Authentication{ "user", "pass", cpr::AuthMode::BASIC },
cpr::Parameters{ {"anon", "true"}, {"key", "value"} }
);
cpr::Response response = cpr::Get(cpr::Url{ "https://example.com" });
std::cout << response.status_code << " " << response.reason << std::endl;
return 0;
} CMakeLists.txt cmake_minimum_required(VERSION 3.25.1)
project(Proj VERSION 0.1.2.3 LANGUAGES CXX)
add_executable(main main.cpp)
target_compile_features(main PRIVATE cxx_std_23)
find_package(cpr CONFIG REQUIRED)
target_link_libraries(main PRIVATE cpr::cpr) |
I'm not using the CMake compiler myself but MSVC one and I never got this issue before it happened after I completelly renewed my vcpkg install. |
|
Does this mean anyone installing the lib now would get this issue ? I'm confused because I think I only have the default version of MSVC.. |
So I seen on the readme that CPR got a NuGet package and: NuGet Package: Compile So I think the it can be a VCPKG issue 🤔 |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
This is happening for me as well, on a fresh install. Don't have a repro-case though |
This is happening to me as well. |
Could you please try those code #39829 (comment) ? If it fails, please append error logs. |
I'm not using cmake though. I wish :( |
-- I was able to fix this issue by removing literally everything i had installed related to windows sdk, MSVC versions, STL versions, vcpkg while making sure to clear my $PATH as well and then painfully installing everything by hand. |
i had the same problem with cpr 1.11.0 get from vcpkg. Does anyone have a solution? |
I discovered my problem and solved it. I need to install the appropriate Visual C++ Redistributable to run the code in other windows. |
It may be a MSVC bug,It's solved after I upgrade the Visual studio to the latest version(17.12.2) |
Could you please help to give some reproduce steps and demo? |
We changed VM after running into that issue, so it hasn't been an issue since after setting it up on a new system. Sorry for no repro |
I'm also seeing this issue, "error LNK2019: unresolved external symbol _Cnd_timedwait_for", building with MSVC via CMake, using cpr 1.11.0. I'll try to boil it down to a minimal repro. Curiously, my coworker can build the same code on his machine just fine without error, which strongly indicates that the cause is environmental in some way, though our environments appear to be the same at first glance. I'm looking more closely for subtle differences. [Edit] My coworker has only one version of the MSVC build tools installed, "v143 14.41". I have two different versions installed, "v143 14.38" and "v143 14.41". When I configure my CMake project, vcpkg finds and uses 14.41:
But when CMake generates the project file for my application, it finds version 14.38:
It would make sense that I'd get linker errors trying to link a lib built with one version of the runtime to an app built with a different version of the runtime (I guess?). Not sure how to correctly fix it yet, though. I could just install one of the platform tools versions, of course, but I'd rather make my CMake system more robust in the face of multiple versions. In any case, this is likely not a problem in cpr specifically, except in that it apparently highlights an incompatibility between the two platform versions. Or that's my working theory right now. Supposedly I should be able to specify the platform tools version with [Edit2] I removed platform tools 14.38, and updated to the latest version of Visual Studio, so now the only version of the platform tools on my machine is 14.42, which both vcpkg and my own project use, and everything is fixed. |
It‘s solved by upgrade the visual studio to the latest version(17.12.2)Sent from my iPhoneOn Dec 3, 2024, at 20:34, Bård Sigurd Møller ***@***.***> wrote:
@bamo-volue @Teles1
Could you please try those code #39829 (comment) ?
If it fails, please append error logs.
We changed VM after running into that issue, so it hasn't been an issue since after setting it up on a new system. Sorry for no repro
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
What redistributable exactly did you install to solve it? |
This also happened to me.
|
Describe the bug
Whenever I install the
cpr
port I can import it but not use it.See libcpr/cpr#1080
Environment
To Reproduce
Steps to reproduce the behavior:
vcpkg install cpr:x64-windows
To make it a very easy reproduce just use the code under, I use
ixx
modules from C++20 but the this issue happen even in the minimal example.Expected behavior
The program should compile.
Failure logs
Additional context
I opened an issue on the cpr repository here
The text was updated successfully, but these errors were encountered: