Sign in to follow this  

Debug and Release

This topic is 2329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have recently finished a program and am now trying to build a release version of the program

Unfortunately my release version doesnt want to work...

I am now questing for more information on this subject, does anyone know any tutorials or books on this subject?

Edit: I am using Visual Studio 2010

Share this post


Link to post
Share on other sites
[quote name='Xeogen' timestamp='1311682629' post='4840466']
I have recently finished a program and am now trying to build a release version of the program

Unfortunately my release version doesnt want to work...

I am now questing for more information on this subject, does anyone know any tutorials or books on this subject?

Edit: I am using Visual Studio 2010
[/quote]

If you paste the build log here, we'll be able to tell you exactly what the problem is.

- Kevin.

Share this post


Link to post
Share on other sites
You should probably use something like log4net to do your logging and then examine the logs when you try to run it in Release mode. In Program.cs wrap the entire content of your stat void Main method in a try catch that catches on Exception and output your exception info to a log and see what that says.

Share this post


Link to post
Share on other sites
[quote name='freddyscoming4you' timestamp='1311687934' post='4840520']
You should probably use something like log4net to do your logging and then examine the logs when you try to run it in Release mode. In Program.cs wrap the entire content of your stat void Main method in a try catch that catches on Exception and output your exception info to a log and see what that says.
[/quote]

Assuming the OP is using c#.....

Share this post


Link to post
Share on other sites
[quote name='ArthY303' timestamp='1311682808' post='4840467']
Usually, most release problems are caused by uninitialized variables and such.
[/quote]

my money is on this one... if we are talking about C++ of course.

Share this post


Link to post
Share on other sites
[quote name='RobTheBloke' timestamp='1311698873' post='4840641']
[quote name='freddyscoming4you' timestamp='1311687934' post='4840520']
You should probably use something like log4net to do your logging and then examine the logs when you try to run it in Release mode. In Program.cs wrap the entire content of your stat void Main method in a try catch that catches on Exception and output your exception info to a log and see what that says.
[/quote]

Assuming the OP is using c#.....
[/quote]
Indeed. Chances are close to 50/50 he is. :)

Share this post


Link to post
Share on other sites
Sorry I always seem to forget some things

I am using C++ and OpenGL, The program itself compiles but the .exe in the release folder doesnt seem to work

Could this be caused by uninitialised variables?

I have checked the build log and Ive only got some warnings for conversions (loss of data)

Share this post


Link to post
Share on other sites
To an extent, you can have the compiler aid you with detecting the use of uninitialized variables.

Enable warnings-as-errors (/WX) and ensure you have at least [url="http://msdn.microsoft.com/en-us/library/axhfhh6x.aspx"]warning 4700[/url] enabled. Also add [url="http://msdn.microsoft.com/en-us/library/8wtf2dfz%28v=vs.71%29.aspx"]/RTCu[/url].

Of course, this shouldn't be used as a crutch as IMHO, *every* variable should be initialized.

Share this post


Link to post
Share on other sites
I havent had a chance to initialise every variable yet, I will report back when I have, I am posting however because I am using files (txt documents) but would that affect the release version seeing as nothing has been moved?

Share this post


Link to post
Share on other sites
Yup, working with files with only the filename without the full path will result in this. Your release exe is searching for the files in the "current folder", which is the folder where the exe is. So, the 'release' folder, and I guess you don't have those txt files there. That's why I asked the question in my first post. Copy the files into the 'release' folder, and see how it goes.

Share this post


Link to post
Share on other sites
[quote name='Xeogen' timestamp='1311790609' post='4841197']
I havent had a chance to initialise every variable yet, I will report back when I have, I am posting however because I am using files (txt documents) but would that affect the release version seeing as nothing has been moved?
[/quote]

But you check for failure conditions in the case where the files can't be opened... right? ....

Share this post


Link to post
Share on other sites
We would need more info... Does the program crash or it just dosen't start?

[Quote=szecs]
Yup, working with files with only the filename without the full path will result in this. Your release exe is searching for the files in the "current folder", which is the folder where the exe is. So, the 'release' folder, and I guess you don't have those txt files there. That's why I asked the question in my first post. Copy the files into the 'release' folder, and see how it goes.
[/Quote]

Copying stuff in the debug or release directory is a very bad idea btw. Never do that. Visual studio lauch the application from the application folder, not the debug/release build, thats where files should be copied. If you want to test your program without the ide, then copy the .exe in this directory instead, delete it afterward, way better this way imo.

Share this post


Link to post
Share on other sites
[quote name='Vortez' timestamp='1311810081' post='4841358']
We would need more info... Does the program crash or it just dosen't start?

[Quote=szecs]
Yup, working with files with only the filename without the full path will result in this. Your release exe is searching for the files in the "current folder", which is the folder where the exe is. So, the 'release' folder, and I guess you don't have those txt files there. That's why I asked the question in my first post. Copy the files into the 'release' folder, and see how it goes.
[/Quote]

Copying stuff in the debug or release directory is a very bad idea btw. Never do that. Visual studio lauch the application from the application folder, not the debug/release build, thats where files should be copied. If you want to test your program without the ide, then copy the .exe in this directory instead, delete it afterward, way better this way imo.
[/quote]

May be very bad, but at least we 'd know where the bug is.

A good idea is to work with proper folders, full pathnames or whatever.

Share this post


Link to post
Share on other sites

This topic is 2329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this