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

libcxx and clang-cl Visual Studio IDE integration #128701

Open
void2012 opened this issue Feb 25, 2025 · 10 comments
Open

libcxx and clang-cl Visual Studio IDE integration #128701

void2012 opened this issue Feb 25, 2025 · 10 comments
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@void2012
Copy link

Hi! I would like to know how to use libcxx + clang-cl in Visual Studio 2022 IDE for Windows. Could someone write a guide or something on how to make it possible? Specifying your own VS directories and redirecting them to libcxx path doesn't work and breaks at random places. Thanks!

@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Feb 25, 2025
@frederick-vs-ja frederick-vs-ja added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Feb 25, 2025
@philnik777
Copy link
Contributor

libc++ doesn't have support for MSVC or EDG, so you can't use Visual Studio as an IDE with libc++. You can use VS Code (or any other editor with LSP support) with clangd if you want though.

@void2012
Copy link
Author

libc++ doesn't have support for MSVC or EDG, so you can't use Visual Studio as an IDE with libc++. You can use VS Code (or any other editor with LSP support) with clangd if you want though.

Falsenuke. There IS support for both MinGW and MSVC environment. See for example: https://github.com/llvm/llvm-project/blob/main/libcxx/include/__config

@void2012
Copy link
Author

Lines like pragma comment(lib, "libc++.lib") hint that it's possible to build libc++ and use with clang-cl. Not to mention other MSVC-specific macro checks in that config file and other files too.

@philnik777
Copy link
Contributor

libc++ supports building for MinGW and MSVC environments, but doesn't support Microsoft tools. You can only build libc++ with clang-cl in those environments.

@void2012
Copy link
Author

I'm not talking about the Microsoft tools (as I don't ever ever use them for personal projects), I'm talking about using Clang-CL build tools, libc++ and Visual Studio IDE

@philnik777
Copy link
Contributor

Visual Studio is a Microsoft tool. For it to work properly your standard library needs to support EDG, since that's what IntelliSense uses. We don't have support for EDG, so you can't use libc++ with Visual Studio.

@void2012
Copy link
Author

What if I disable IntelliSense? It is too wasteful on resources. I guess clang-tidy and clangd are a better tool

@philnik777
Copy link
Contributor

I guess you can do that, but I don't know why you'd use Visual Studio at that point. AFAICT you want to disable basically everything that it ships with. Anyways, there is a guide on how to build for MSVC here if that's all you want to do.

@void2012
Copy link
Author

Uh not really. For example Visual Studio provides the best debugging experience on Windows.

@philnik777
Copy link
Contributor

I'm pretty sure you give (at least parts of) that up as well, since there are no pretty printers for libc++'s containers in the visual studio debugger. It might mostly work, but I'm not sure you'll actually get what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

4 participants