C. Martin
C. Martin

Reputation: 35

Visual studio c++ based exe doesn't do nothing

My c++ application in visual studio 2015 runs perfectly. It uses an input file and generates a bunch of other files.

When I try to use the .exe file from the Release folder, it disappears. And when I run it from cmd, it does nothing..

Maybe it's to little information I can give you but.. I don't really know how to explain it better...

Upvotes: 0

Views: 821

Answers (2)

elanius
elanius

Reputation: 477

You can still debug it. I think you could run it but it immediately terminate. Place breakpoint at beginning of code __asm{ int 3 } or __debugbreak(). It will crash immediately and now you can attach debugger and continue with debugging to observe what's going on.

Also you could turn off optimization for release to debug it easily.

Upvotes: 0

Dragos Pop
Dragos Pop

Reputation: 458

There are multiple problems that might lead to this so I cannot give a full answer, but most issues come from:

  • using relative path, current working dir is defined in project properties->debugging->working directory and by default is project dir

Solve: Review the code for filenames loaded without using full directory path. Copy those files in your relese folder (the folder structure relative to release for these files, must be identical to the one relative to vcxproj

  • using dll-s that have path configured in IDE but not in windows.

Solve: Use depends to find them and copy near the exe: http://www.dependencywalker.com/

Upvotes: 1

Related Questions