EXE stops working if containing folder is renamed. MSVCP90.dll - c++

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?

Related

Qt is remembering previous versions of my code

What am I doing wrong?
1. I write some code in Qt Creator, it works.
2. I save all, copy the folder with all the files in it to another location for safekeeping.
3. Then I write more code. This additional code doesn't work and I've gone too far to undo it.
4. So I close Qt, delete that folder, move the earlier one back to where it was originally, and load the older version.
But Qt still gives me the same errors that the newer code gave me, and won't run. It seems to remember this newer (bad) code even though it no longer appears anywhere in Qt - and the problem persists over computer reboot. I feel I'm missing something very obvious, but Mr Google can't help at all.
Try Build->Rebuild all. Your IDE is probably caching some of the previous results for performance reasons. I had the problem once using Qt Creator, and it solved it for me.
Delete the build folder. All that the build system knows about is the built files being newer than your now even older sources*. So a build won't succeed since plenty of intermediate files are wrong.
By the way, you really should be using version control, not moving folder around. I suggest git via smartgit, but that's just my personal preference. It's effortless.
* A build system could remember the absolute timestamps of the source used in the build and rebuild if they change, not only if the sources are newer than the results.

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

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.

VS Community 2013 can't debug project in solution, even though solution builds and runs without issue?

A point to note:
I recently switched to a computer that has a hybrid SSD and HDD setup, since the SSD is small enough that it is best kept for the OS alone.
The Windows partition has 60 GB of space, and access to a 500 GB partition on the HDD.
The problem:
I cloned the project files to a directory using the GitHub windows GUI (I do all version control through the GitHub GUI, rather than using the built in VS functionality).
I was able to build the solution successfully. Then, upon pressing the "Start Debugging (F5)" button, I get the following error:
Here are the relevant project properties for the project in question:
What it looks like: it looks like \.\ isn't being parsed properly as "current directory". However, this is very weird given that I don't have any issues with the same project settings on other computers. EDIT: From further explorations (see below), I later found out that its not a parsing error, since VS cannot find the file in general. So, I wonder if it has anything to do with the recent switch to a new computer, and the way hard drives are set up? I think it is unlikely to be a problem with my GitHub workflow, since GitHub does not care about the Debug directory (it is ignored).
What could the issue be?
Things I have made sure of so far:
There are no errors in the CodeChain project (i.e. the build is successful without any weird errors):
I thought this might be an issue based on some other "Unable to start program" hits I got on Google, but I am able to rule it out.
I reverted changes by deleting the new branch I was working on, and completely cleaning the project from the disk in case it was an obscure error. I then recloned to its earlier last known working state, and got the following. I still get the same error.
I know for a fact that the file exists, and I also tried using a different variable to denote the directory where the output is located:
I still get the same error:
Maybe the double slashes are a problem (but they shouldn't be, right?). So I take out the superfluous slash: $(ProjectDir)Debug\. No luck:
Surprisingly, the solution as a whole does run, when I select the main project as the startup project!
The project I am trying to open creates a static *.lib file. This cannot be opened and run.
There is no way the project I was trying to debug was opening on other computers. Rather, I probably had a different startup project selected.
Indeed, this was the issue. I had forgotten which startup project I needed, and thus was not opening the right one.

How to build standalone SDL project with visual C++?

I'm getting ready to enter Ludum Dare this evening, and I'm getting really frustrated because I'm unable to build my project into a standalone .exe.
I feel like this question has been asked at least 100 times but none of the answers I'm finding are helping me out at all... I don't really understand what static linking is or how to do it, and that doesn't even seem like the solution to my problem; I don't mind if I'm shipping out a bunch of .dll files with my program, I just want the program to run on its own so I can submit it at the end of the competition.
Basically, my visual studio (2010 express) configuration follows exactly LazyFoo's tutorial on setting it up. Everything runs fine on both debug and release configurations when I start the program from visual studio, but when I navigate into the Debug or Release folders of the project and try to run the .exe, the programs break with an error about abort() being called, or they give me the error "X program has stopped working."
I'm including all of my DLLs in the same folder as the executables are being placed, and the game runs perfectly fine from inside VS, but I just can't seem how to figure out how to compile it as a standalone .exe (or even including a folder full of dlls) without it falling apart.
Can someone give me a pretty precise way to get this working? Any help would be great.
If you have an EXE, then your program is compiling. Most likely in debug mode, the program is running using a specific directory as the current working directory (CWD), but when you run it as standalone, the CWD is different.
The CWD affects both the DLL that can be loaded as well as the search of any file that uses a relative path (that is, not starting with a [back]slash). That is probably your problem: textures, graphics, configuration files, fonts...
My advise is to set the CWD in the debugging runs (there is an option for that) to be exactly the same than that of the EXE, that is the default when you run the EXE. Then you will be able to debug your crash.

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.