Link to home
Start Free TrialLog in
Avatar of Maria Torres
Maria Torres

asked on

Why when I convert my solution from Debug to Release version, the program doesn't work anymore?

I finally was able to get the C++ program to compile without any errors and was able to produce the output without any issues.  When I compiled it into executable and tried to run on an XP machine, I received a message indicating that it was not a WIN32 application.  I then created a new project and selected "Visual Studio 2013 - Windows XP (v120_xp)" as the new platform.  I also specified that this executable be compiled as a Release version.

Now when I try to run the program, I get errors for fscanf, strcat, strcopy, where I didn't before.  I changed the fscanf, strcat, and strcopy to the secure functions (i.e., functions ending with _s).  My program still does not work.  

I'm not a c++ programmer nor am I experienced in Visual Studio 2013.

Can someone tell me what I am doing wrong?  Why changing the program from debug to release would result in errors?  And how can I get the program to run in an XP platform?
Avatar of n2fc
n2fc
Flag of United States of America image

I am presuming it ran OK in debug mode...

Typical cause for this type of behavior is an uninitialized variable, which exhibits changed behavior due to stack changes when removing debug.
Avatar of Maria Torres
Maria Torres

ASKER

Yes, it ran perfectly in debug mode.  Is there a way in debug, to catch the culprit that is causing the problem?
Hi CarmenMTorres,

probably your RELEASE build is a 64-Bit application or is built for higher Windows version (i.e. take a loot at http://blogs.msdn.com/b/dsvc/archive/2009/06/19/troubleshooting-not-a-valid-win32-application-error-at-the-startup.aspx).

ZOPPO
>> Is there a way in debug, to catch the culprit that is causing the problem?

Check out https://msdn.microsoft.com/en-us/library/fsk896zz%28v=vs.110%29.aspx ("How to: Debug a Release Build")

>>  I get errors for fscanf, strcat, strcopy

Wait a minute, do you get these errors when building the release version or when running it? If that is during the run, what exactly are the messages?
Try running "lint" on the source to check for uninitialized variables...
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial