C++ Microsoft Visual Studio 2015 Debug issue (Cannot find or open the PDB file.) - c++

Very new to coding as well as compilers. I have recently started learning C++ and have been attempting to use Microsoft Visual Studio 2015 as my compiler. Unfortunately every time I try to compile even the simplest of programs, I continuously get the same error. I have looked for other solutions but everything seems to be outdated showing either 2010 or 2013 Microsoft VS. I have tried editing the debug options, "Load dll exports (Native Only) as I saw that that could have been a possible solutions but that also did not solve the issue. If anyone can help me out it would be very much appreciated, also if you could explain the issue as simply as possible it would also be much appreciated as I said before, I know very little about coding or the compilers yet.

In Debug -> Options -> Symbols check if you have folder where you have PDBs and Microsoft Server. Also create folder for Cache, and have "Load all modules" checked
Get Debug -> Windows -> Modules, and start app step by step. Go inside until you see you app in Modules, right click on your module and try to force loading symbols.

Related

Cannot open source file in a CMake Project in Visual Studio

I have a C++ Project in Visual Studio 2022 (Windows 11) that is put together using CMake. I understand that the difference here is, that my project is not a Solution but rather just folders with code and the CMake tells it how to compile it?
But my problem is, that it doesn't seem to find C's standard libraries and shows error "cannot open sourcefile".
Screenshot
The error is definitely not in the project, since it runs just fine on my laptop, just not on the PC I want it to run on.
How can I tell it where these libraries are? Where are they located even?
Any help would be greatly appreciated and I can share more files on request.
Things I have tried:
Going to properties and choose the correct Windows SDK Version - The properties are empty
Comparing every variable of the CMake Settings with the ones on my laptop where it works
completely reinstalling Visual Studio (yes I did that)
looking through lots of StackOverflow questions but none of them describe my problem

Missing MSVCP120D.dll but don't have Visual Studios anymore

I dug up an old project of mine from college when we exclusively used Visual Studios, and I'm looking to run it again. I don't have the exe anymore, just the debug version. When I run the debug version, I get the missing MSVCP120D.dll error. I have no way to recompile this into the release version. Is there a way for me to download the missing dlls, without downloading Visual Studios?
Incase you didn't know, MSVCP120D.dll is a dynamic link library for the IDE "Microsoft Visual C++ 12.0", which I believe is from Visual Studio 2013.
If you know the version of Visual Studio that you used (You specified 2010 and 2012 in the tags), you can use the following link to download the toolchain, Visual C++: https://support.microsoft.com/en-gb/kb/2977003
Another option is reverse-engineering, but this will be an incredibly difficult process and cannot give you the source that you originally used to create the debug version. Your best bet is to find the version you're after, if not re-writing it.
This installation, should you have the administrator privileges to perform it, should cause the error to cease, as your system will be able to find it in Sys32/Syswow64.
Edit: I would be vary wary to download a .dll from any other site other than Microsoft's official site, malicious DLLs are readily available from dodgy sites.

How to make the Visual Studio profiler show function calls properly

My Visual Studio (2012) does only show me the .exe and .dll files in the profiler. I searched the internet but I can not find a proper answer to my question. I asked my teachers aswell, but none seem to know the answer.
This is the only thing I see:
Image
EDIT: I still can't seem to fix this, after +- 2 months. I tried some settings and my project settings have "Generate Debug Information" set to "Yes".
Please update to the latest version of Visual Studio 2012 (it has some symbol bug fixes). The problem you are seeing means we cannot decode the symbols, let me know if the update doesn't fix your issue

MSVCR100D.dll error at runtime

Ok , so i created a program using VC++ 2010. it ran just fine.
Got to work and could only install vc++ 8 due to having a crappy computer that is still stuck on xp sp2...
Everything will link up and build with no errors, But when the program starts to run i get "This application has failed to start because MSVCR100D.dll was not found"
I tried changing the runtime libary from MDd to MTd but still no luck...any idea?
That DLL comes with Visual Studio 2010. If you want to use your program, you'll somehow have to get your hands on it. If possible at your work, you can download it. Another (probably better) option would be to take it with you from home on a USB drive.
Edit: You can also try re-creating the project, and then copying the source code over into the new project. Your newly created project (in Visual Studio 2008) should not be depending on that erroneous DLL.
Edit 2: As Hans Passant added in a comment, this DLL is needed by Debug compilations of your program. So if you simply compile as Release, you can safely ignore the first part of my post. (I hope I'm not breaking gentleman rules by adding this to my post.)
MSVCR100D.dll is for debug mode, and is installed with visual studio 2010, since 2008 has MSVCR80D. You can just google that and download it, and put it in the same direcrory, or just complie in release mode.
here is a download link. You need the small download zip file button, not the big ones.
http://www.dll-files.com/dllindex/dll-files.shtml?msvcr100d
As I know, MSVCR100D is debug version of runtime library used by VC2010。So, if your point either is:
(1) you do not have that dll which you really need, you can download at http://www.dll-files.com/dllindex/dll-files.shtml?msvcr100d or
(2) you want to run that program without requirement of MSVCR100/D.dll, you may need to recreate a project in VC8, then substitute with your source files (not solution file or other files managed by Vistual Studio).
FYI: If my memory were not going wrong, I remember that a project created by higher version of VS cannot be opened directly by lower version one. So, how did you build them?

Using Visual Studio 2010 C++ compiler and linker without Visual Studio 2010 having been installed

At my company we really like for our development tools to be able to be used from perforce, without having been installed. For a lot of tools (perforce, gcc compiler, snc compiler, even maya) this works after some tweaking, but for Visual Studio 2005 we could not get it to work. As far as we could see, the problem was caused by mspdbsrv.exe. When VS2005 was not installed, the linker would regularly exit with an error about a corrupt pdb. When VS2005 is installed, we almost never see this error.
Does anybody know if this is possible with Visual Studio 2010?
See here. This will install compilers, headers, and win32 development tools if you select them. Exactly what you need: toolchain without IDE.
Yeah, mspdbsrv.exe would be a hangup. It is a service required to arbitrate access to the program database to allow concurrent compilation. Can't get a service going without getting the registry entries right.
This did not improve in VS2010. It has an entirely new build system, based off MSBuild. There's a ton of stuff that needs to be set just right in the registry. Pretty unlikely to get that right and trouble-free without using the installer. Takes half an hour or so, not worth your time.