VS C++ All of a sudden no symbols, cannot debug - c++

I was debugging fine just yesterday, woke up this morning and all of a sudden I can't use breakpoints. I tried rebuilding, I made sure I was using the right exe and dlls.
What should I do?
-I didn't change configuration settings. I have it on debug.
-When I press F5, it runs, does not promt anything. The only thing is that when I place a breakpoint it says (while hovering over the break point) "no symbols loaded for this document."
-I did not move any files around.
Attept to figure it out: Changed something in the code, looks like that changes was not reflected in the dll, maybe I'm in fact not using the correct files, will look into it...

Alright sorry, figured it out...
Turns out there were TWO dlls, one old version, one new, and my exe was referring to the old version.
Sooo to answer my question: Do a search for all related files to your project, make doubly sure all old files of old builds are deleted. Try changing the code. If changes are not reflected, you know those changes are not going into files you're using.

Related

Why doesn't my visual studio build properly?

Okey, I am REALLY having problems with the Visual Studio 2012, and looked all over for a solution, with no result.
So the problem is this... Usually the play button, starts building and debugging in the end running the program. And each time a source file is updated, it should do that again. Well, for me it does not. Every time I write something new in a file, I need to REBUILD the program and then hit play, when before, just hitting the F5 button would do the trick.
The thing is, I have checked, all probable causes that were diagnosed over the internet, so no it's not related to the settings in visual studio, and no, it's not a timestamp issue.
The oddest thing though, is that sometimes, some of the files inside the project look excluded( they have a tiny red circle on them and I have to select and reinclude them). I do not understand why that happens, they were not implemented by me, they are just some "dependency" files on which other classes that I am ussing are built.
Furthermore, the problem of not updating the program. At the moment I have 2 classes. If I write code inside one of them, F5 will work properly and run with the expected modified result. On the other class though, nothing will happen. F5 will find no errors, but it will run without any modification, altough there was code added in one of the classes.
This is really driving me crazy, and I really need a conclusive answer. Why are the dependencies file being involuntarely excluded? Why does visual Build correctly changes from one file but not from another?
You made your visual studio to do it (i.e to launch code with errors).
By default when there is an error you get this popup:
Now if you tick the checkbox - VS will not bother asking you again;
even when errors occur - it will just execute last executable that it has.
To revert this change - go to: Tools > Options > Project & Solutions > Build & Run:
Change this setting to *Prompt to Launch and you are done.

Visual Studio 2012 C++ build failed but nothing on the error list or output

Alright so I was a few weeks into this program with no error like this until I woke up this morning and tried to run the project again. When I try to run it the build fails however there is no error of any description in either the error list or the output views. I've checked and made sure that VS is showing all errors and commented out all new code from the passed few days that I added.
I even started a new project and tested different code and it worked just fine. I've looked around the net but I can't find anything of use. I'm hoping someone here might be able to shed a little light on this for me. The project is about 24 files at this point so I'm not sure if I can really post the code.
One thing I do know is that recently a friend of mine on the same network as me accessed the project to look at it from his computer. I have no idea if this would cause this problem but I guessed I should mention it just in case it is related. I should also note I have rebuilt the project twice with no effect. The only thing I know I can do is copy and paste the code to another project but I really don't want it to come to that. Thanks in advanced.
Try to remove *.suo *.aps *.sdf in your project directory and remove Release or Debug directory which contains *.obj files.
then rebuild your project.

What VS2010 C Project settings cause exes to require Compatibility Mode

I've been running and compiling a program on my Windows 7 64-bit machine for several months now, but recently I had to change several VC project settings of the static libs that it uses and now the generated executable file requires me to run it in "Windows XP Compatibility Mode".
Compiled on Windows7 64-bit machine with Visual Studio 2010 SP1
The program I am generating is being built in Win32, debug mode.
The static lib projects specify Target Machine /X86.
When I run the program from the debugger, it start up and runs, however if running via the windows icon, it requires XP compatibility mode.
When trying to start outside of the debugger the EXE shows up in task manager for a second then goes away.
I've tried using Microsoft Application Verifier on it, however I don't know what to look for in the output.
I've been unable to find any details on how to troubleshoot this issue so if anyone has any ways if finding what could be causing this recent Compatibility Mode requirement I'd love to hear how it was fixed.
I have the source/projects/solutions for the majority of the static libs that I link against, as well as the exe file generated, however some of the external dependencies I only have the .lib,.dll, and .h files for. This means I can change (most) of the project settings for the dependencies if neccessary, but I need to know which ones to look for.
Thanks
To be honest, don't be afraid to make another project and copy the code files, even if it's 5 projects. You need to cut the problem in half. If it works with the new projects then it's the project files, if not, it's the code. Making projects isn't that hard really, though I'm sure a source of much consternation and something people avoid. If its the projects you can diff the files and see what happened by process of elimination. If you are really worried, copy the entire solution to another folder; always make backups.
The problem is that you probably won't be able to hoist enough information up to us to get a meaningful answer unless get lucky, and all the answers will be shots in the dark.
So I'm goign to take this question as "this happens, what can I do about it". The strategy above will get you out of it, if this used to work before. This exercise will arm you for the future and will be more productive in the long term. Go look at UAC and manifest files, aka Vista+ difference tht dramatically changes load and run behaviour (Linker Commands, Vista Migration Guide) if you need one thing to look at, but try the above process.
----
Other generic things to try:
1) another machine
2) another install of VS
3) a simple project with one window that does nothing to prove everything else in your tool chain and environment is ok.
4) planting message boxes along the code path with different messages so you know where its crapping out.
5) turing on pdb in release and runnign outside of debugger. If craps out, then try debugging and see if still craps out, but you get to see where.
6) assume that your code is unstable and you were getting lucky when it used to work. (this one is no fun). Many times things work in debug and not in release due to mem layout being different. If your progam is large you can find creative ways to use #if's whatever to elimitate code from running while haivng the whole thing still load. You can find the code that causes the bad behaviour.
7) turn off UAC and error reporting if its on, see if changes.
8) go find the "run without debugging" menu button in Visual Studio, so you don't have to go run it with the icon. That's an accident waiting to happen, and eliminates one more environmental difference. It looks like the run with debugging button, but it's hollow, a plain green triangle. It's under debug menu set. My oppinion is that it has done more harm than good to not have that on the bar by default as its confused many many people to think launching wiht VS means always using the debugger.
and so on....

Visual C++ Build / Debugging Issue

I'm having a weird problem with Visual Studio. Whenever I change my code and build, even though I get the notification that the built was successful (and if any, it also shows errors in code and doesn't build) the executable is actually the previous build. This is getting really annoying and frustrating.
If I put a breakpoint on the new lines, the breakpoint gets disabled and it says
The breakpoint will not currently be hit. No executable code is
associated with this line. Possible causes include: preprocessor
directive or compiler/linker optimization
If I put a breakpoint on old lines of code, it stops processing but shows me this message
The source is different from when the module was built. Would you like
the debugger to use it anyway?
I never had this problem before and the source code in on my laptop's hard drive. It saves right away. The only way to get around this to Clean the entire solution manually every time, instead of basically pressing F5.
Thanks everyone for their suggestions. My mistake was that I defined the classes inside .cpp files, this somehow caused the linker to do weird (caching probably) stuff and link the old objects. I renamed the file to .h and everything's working as expected.
Perhaps your code is not built, or is built in a way you don't expect.
You might check by inserting a #error foobar preprocessor directive somewhere. If no error shows when building, you know you are in trouble!
But I never used Visual Studio (I'm only using Linux) so I cannot help more.
It might be that you have set main project some other project and building that.
make your project that you want to work on as "Main Project " by set main project available in menu bar.
I think you are using source files from another project (ex: if you are using a dll say, my.dll (which was built using some source files say, mycpp.cpp ); in your current project).
When you debugged into the file (mycpp.cpp), maybe you modified it.
Hence you need to rebuild the dll (my.dll) first in the project in which you created my.dll .
Or
Maybe you have opened a instance of mycpp.cpp in a window & debugging in another window.
you should rebuild the dll.
If you are not using files from another project, then I cant guess the cause...but still I would recommend using rebuild rather than clean & build.
please clarify your Question a bit.
#David expecting a reply from you...
I was looking for an answer to this issue since I was also stuck with it. A colleague of mine just gave me a solution that works. Yes, it seems really stupid, but it did the trick for me.
Our solution has many projects. He told me to select the project that I wish to break into and set it as the startup project (right-click on the project name and pick "Set as startup project"). I was desperate, so I tried. To my amazement, it works.
Since I have this window opened, I thought I'd share it in case someone else is stuck with the problem.
I faced the same problem. But reason was not as yours.
Then I just restarted the visual studio and it ran as expected.

EXE stops working if containing folder is renamed. MSVCP90.dll

This popup comes up as soon as the app is started:
The program can't start because MSVCP90.dll is missing from your computer.
Before anyone says "install the VC++ runtimes", wait! If I rename the folder containing my .EXE then the app runs. If I rename it back, it breaks. The app has been running for weeks without any changes to my system/VS installation (2008 SP1), we suddenly spotted this error a few days ago.
Lost as to why the name of the dir is causing issues... again this has not changed in months and all our resource paths are relative anyway, e.g "../someOtherDir/...."
It doesn't just do this on my PC, we have the /bin dir (the one containing EXE) in SVN and suddenly everyone started seeing the same issue, even though the binaries themselves seem just fine. Is it possible some additional data got put into SVN and that's the cause? Since it's not just one PC, there must be something either in SVN or the EXE itself...
Note this popup comes before our code even gets to run.
It seems that there is a .exe.manifest file lying around, specifying some other version of MSVCP90.dll. Removing this file should do the trick (In theory the manifest is the solution against dll hell, but in reality it is just a new PITA).
Try rolling back to some earlier SVN revisions and see if you can identify a change which made it stop working. A binary search will be most efficient for this. PATH settings might also be an issue?