Skip to content
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

HAVE_THREADS and Visual Studio 2022, version 17.8 #1004

Closed
jvxgit opened this issue Nov 16, 2023 · 2 comments · Fixed by #1005
Closed

HAVE_THREADS and Visual Studio 2022, version 17.8 #1004

jvxgit opened this issue Nov 16, 2023 · 2 comments · Fixed by #1005

Comments

@jvxgit
Copy link

jvxgit commented Nov 16, 2023

Hi,
I just installed latest version of VS 2022 yesterday, version 17.8. Starting from version 17.8, MS declares to support c++ threads,

https://devblogs.microsoft.com/cppblog/c11-threads-in-visual-studio-2022-version-17-8-preview-2/

In libre, CMake checks for the existence of c++ threads,

check_function_exists(thrd_create HAVE_THREADS)
if(HAVE_THREADS)
list(APPEND RE_DEFINITIONS -DHAVE_THREADS)
endif()

CMake returns that, yes, it supports c++ threads. But then, it seems that Microsoft forgot to add the header file <threads.h>. So, I have found HAVE_THREADS to be true but then, compilation fails since <threads.h> can not be found in re_threads.h. CMake only checks for the existence of the symbol thrd_create but it does not look for the header as it seems..

My workaround is to comment out these lines with HAVE_CONFIG in <re_config.cmake> when using Visual Studio 2022. Or am I missing something?

Best regards

Hauke

@sreimers
Copy link
Member

Thanks for reporting should be fixed by #1005

It's strange that threads.h is not available but mentioned in the blog post. Found no flag or other workaround.

@BillyONeal
Copy link

I think it was a mistake in setup authoring. It was filed on Developer Community here: https://developercommunity.visualstudio.com/t/Missing-threadsh-in-MSVC-178/10514752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants