Where is LLDB in the Visual Studio 2019 clang extension? - c++

Visual Studio comes with built-in clang support that can be enabled when installing. I have installed that support and now have all the clang executables in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin.
I'm not using Visual Studio for development but just its clang build chain, I'm using CLion instead. Building works fine, but I have trouble debugging. I cannot debug, even though CLion says that it uses the "Bundled LLDB"; something just seems to go wrong, but CLion doesn't tell me what.
I have the suspicion that it somehow chose the wrong LLDB, so I wanted to check whether I can debug in the shell. But then I realized, that I am unable to locate that "bundled LLDB" CLion is mentioning. There is no lldb.exe in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin. In fact, I couldn't find an lldb in any subdirectory of C:\Program Files (x86)\Microsoft Visual Studio\2019\Community. So where is the debugger for Visual Studio 2019 clang? Or which other debugger could I use? Could I use the native MSVC debugger instead? If yes, where is this one located?

You would have to build it yourself. From the website:
(*) Support for Windows is under active development. Basic
functionality is expected to work, with functionality improving
rapidly. ARM and AArch64 support is more experimental, with more known
issues than the others.

Related

How to run Code Analysis on x64 Project in Visual C++?

I am trying to run the code analysis of Visual Studio 2015 on my x64 VC++ project. However I get the following error:
Error C1250 Unable to load plug-in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin\localespc.dll'
I am activating the x64 toolset of Visual Studio by running the batch script "vcvarsall.bat amd64" before I start the IDE. Visual Studio is run with the "/useenv" option afterwards.
When I check the VC++ environment variables, I can see that the following path is contained in the PATH variable:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64
How can I tell Visual Studio to use the code analyzer (localespc.dll) from there and not the x86 version which it apparently tries to use (according to the error message).
Thanks a lot for your help!
I was having the same issue with my 64-bit C++ projects. I discovered simply renaming/removing localespc.dll from VC\bin allowed the Code Analysis builds to succeed and still report analysis warnings. It seems if VS doesn't find this dll in the VC\bin directory then it won't add the compiler switch for /analyze:plugin but otherwise passes all the other switches required by the Code Analysis.
Set the following property in your project file: <PreferredToolArchitecture>x64</PreferredToolArchitecture>
This tells Visual Studio to use the 64-bit version of various tools, including code analysis. I found How to make Visual Studio use the native amd64 toolchain helpful on the topic.
Note that renaming localespc.dll no longer solves the problem with Visual Studio 2017. It seems that setting PreferredToolArchitecture is Microsoft's intended way to do this.

Microsoft Visual C++ compiler for Dymola

I would like to use Microsoft Visual Studio 14.0's built in C compiler for simulation in 32-bit Dymola Demo Version 2017. I have opted to include C++ compiler during MVS installation and the files exist in the proper locations. When passing Dymola the location to the compiler, I receive the error:
Compiling and linking the model (Visual C++).
Error in script usage. The correct usage is:
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin\vcvars32"
or
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin\vcvars32" store
"Testing 32-bit compilation"
The command "cl" is either misspelled or could not be found.
Below attached are my settings.
Microsoft have changed some scripts or directory structure.
Visual Studio 2015 (aka 14.0) is supported out of the box by Dymola 2017 FD01 or newer,
so the easiest solution would probably be to switch to the very latest Dymola version:
https://www.3ds.com/products-services/catia/products/dymola/latest-release/
Also, when installing newer versions of Visual Studio, you should make sure to install the C++ components!!
If you forgot to install those, you can still install them later by following these steps:
open Visual Studio
click File, New, Project, then Templates, Visual C++
if the C++ parts are not installed, you will have the option to install them here
after that, you should be able to run the compiler test as shown in the screenshot below

Using nvcc with CUDA 6 and VS 2012 Express

I'm trying to get started with CUDA and a 64-bit compiler on Windows 7 SP 1. Ultimately, I wish to compile mex-files for use with Matlab (R2014a). I have an older computer which I successfully configured to do this using older versions of CUDA and VS C++ Express, but I can't seem to get it to work with the newer packages.
I've installed CUDA 6.0 and Visual Studio C++ 2012 Express, which web readings suggest should work together. I'm not sure whether I also need the Microsoft SDK, which used to be necessary in order to get the 64-bit compilers; it seems that these are included with VS these days.
I created a vcvars64.bat inside 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64'. I also made a copy of the entire directory renamed to 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64'. These steps used to be necessary for older versions -- not sure if they still are.
However, when I try to compile, I get the following error:
nvcc : warning : The 'compute_10' and 'sm_10' architectures are
deprecated, and may be removed in a future release. nvcc : fatal
error : nvcc cannot find a supported version of Microsoft Visual
Studio. Only the versions 2008, 2010, and 2012 are supported
Compilation errors found: terminating.
I'm compiling as follows:
nvcc --cuda myfile.cu --output-file myfile.cpp
Following this I would call mex within Matlab to build the mex file. But I can't get past this first step. Does anybody know how nvcc determines where to look for the compiler, and how I can get it to recognize a supported compiler? Note that 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\cl.exe' is on the system path.
Try to run vcvars64.bat and matlab both from the command line. This makes the correct VS environment variables known to Matlab and nvcc.

C++ - Visual Studio's compiler set up in Code::Blocks?

Honestly I like Code::Blocks (v13.12) much more than Visual Studio because it doesn't eat up my RAM. I was wondering: I recently installed Visual Studio 2012 Professional, and attempted to set the compiler up to work with Code::Blocks, but upon viewing the files included, I was missing a few critical C++ headers and, in addition, Microsoft's resource compiler, therefore I could not successfully get it working with Code::Blocks. There were no errors when I installed Visual Studio, so why would I be missing headers and their resource compiler? Are those not included in the professional version? Do I seriously need to get a copy of ultimate?

Eclipse CDT can't build - not sure what's wrong (console included)

I'm now going to give c++ a try to see what this language have to offer. I'm having some trouble setting it all up though. I have downloaded Eclipse CDT and followed this guide : http://www.dcs.vein.hu/bertok/oktatas/cpp_by_eclipse/eclipse_for_cpp_on_windows.html#Install_gdb
I am using Windows 7 64bit.
I have never installed a compiler before, and I'm not sure what exactly I am doing wrong. It gives me an "Launch failed. no binary found" error when I try to run my program. However there is no binaries folder. I have tried building, it loads for a while, but nothing really happens.
Any idea what to do? I am completely new at c++ so please be patient and let me know if there's anything I am missing :)
The console in eclipse says the following:
Build of configuration Debug for project Test2 **
Internal Builder is used for build ** cl /c /EHs /MD /Zi /nologo /Fospam.obj ..\spam.cpp Internal Builder: Cannot run program "cl" (in directory "C:\cppworkspace\Test2\Debug"): CreateProcess error=2, Den angivne fil blev ikke fundet Error: Program "cl" is not found in PATH
PATH=[C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\EgisTec\MyWinLocker 3\x86;C:\Program Files (x86)\EgisTec\MyWinLocker 3\x64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\MinGW\bin] Build error occurred, build is stopped Time consumed: 156 ms.
If you will compile with Eclipse CDT + MingGW Compiler you should use the MinGW toolchain
MingW Toolchain
If you want use Eclipse + Microsoft C++ compiler, need change for "Microsoft Visual C++" toolchain and put in PATH
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
or whatever you have because CL program is there...
The problem is simple enough, Eclipse can't find your compiler.
On the lengthy PATH that is quoted I don't see 'c:\MinGW\bin' so I'm guessing you had problems with step 4 under section install MinGW.
Having said all that I don't think Eclipse is a very good environment for developing C++ and I don't think MinGW is a particularly good compiler. I'd seriously recommend you take a look at Visual C++ 2010 Express, which you can download from here http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
EDIT
OK now I do see 'c:\MinGW\bin', so apologies for that. I think the likely explanation is that you have selected the wrong 'tool chain'. Eclipse thinks you want to build with Visual C++ but you have downloaded MinGW. But really get Visual C++ 2010 Express and forget about Eclipse, it's much easier.