Jump to content
  • Advertisement
Sign in to follow this  
ajm113

Releasing my project in VS2008? (C++ Win32)

This topic is 3548 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

Hi, I want to release a C++ project of mine so it can be used on other PC's which don't have the libs for VS2008 debugging. The problem is that if I do release my project I get a butt load of MessageBox Errors like this: error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'. Is there a safe way to keep everything the same so when I compile the release executable it doesn't require recoding of the MessageBoxes and so forth? Any thing I should know when releasing a C++ Win32 Project? Thanks, Andrew.

Share this post


Link to post
Share on other sites
Advertisement
Looks like you've set "Use Unicode character set" in Release mode, but "Use multi-byte character set" in debug mode. It's on the "General" page of the properties.

Share this post


Link to post
Share on other sites
Alright thanks, what if something like a bug only happened on release mode, but never happened on debugged mode, what should I do?

Example of two bugs:

I am using Fmod and for some reason I get a access violation on release mode when I close Fmod. I also get some jumps on some objects I have moving in release mode.

Share this post


Link to post
Share on other sites
Set up your release build to build in debug information so you can debug issues with fmod and the like. Most likely you're accessing a handle after fmod is destroyed. Also make sure you're linking to the release version of the fmod libraries.

Share this post


Link to post
Share on other sites
Alright I fixed it. Im still getting this jumpy effect on my camera or models though witch is really wired all the sudden in release mode.

I'm using OpenGL fyi.

Share this post


Link to post
Share on other sites
Check for uninitialised variables and buffer overruns.
Turn up your compiler's warning level if possible.

Share this post


Link to post
Share on other sites
Quote:
Original post by ajm113
Any thing I should know when releasing a C++ Win32 Project?

Yes. You should know about this problem.

This is one solution, but it might not be the best. There is a way to make it so your .exe includes the manifest files or whatever it is, so that installing the aforementioned package isn't required. I'm not sure how, but it's on the net.

Share this post


Link to post
Share on other sites
Alright, thanks guys I'll see what I can do and see if I can get this lag out of the way later today.

I appreciate your guys help! :D

Share this post


Link to post
Share on other sites
The best way to avoid redistribution headaches (like 'application configuration incorrect') is to static link everything.

Use 'MFC in a static library' instead of 'in a shared DLL' if relevant, use ATL static linked if you use it, and use the 'Multithreaded' runtime library instead of 'Multithreaded DLL'.

This basically compiles everything in to the final EXE. It vastly reduces your dependence on external DLL files, and therefore, reduces errors from people not having those DLLs. You won't even need to bundle in the MSVC++ redist package.

Share this post


Link to post
Share on other sites
Although it might seem to fix errors, I strongly advice against it. You encounter even more troubles with static linking (besides the increased size).
It will work fine if you're only working on a signle executable, but if you're also programming some dlls, you will get nice errors with a statically linked runtime library (you will need to ship the redistributable package with your application if you do a dynamic link) when you pass std::strings between your application and a dll.
I'm not shure if the same thing goes for the MFC, but it should lead to errors as well, if you pass MFC objects between your application and a dll that both statically link to the MFC.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!