Q:

debug vs release build in Visual studio c++ 2008 win32 runtime issue

I have a simple udp listener written in c++ using win32 when I compile and run the program under debug mode it works perfectly, and I'm clearly able to see the information from the packets that I'm receiving. When I run this same code as a release build it compiles fine and seems to run fine, but its not printing out any packet information like it did under the release build. I've tried to mirror the build configurations to match exactly but its still happening. Any suggestions would be greatly appreciated. 

A:

This is more likely an issue of not initializing variables to some initial value, so in debug they have some sort of value, but in release, most things are initialized zero (NULL).  So, some condition/branch may be taking place, that you do not expect...  Without your source code for example, it's REALLY hard to spot issues.
This has bit me more than once..  :)  
This is assuming you are not expecting to see anything using stuff like OutputDebugString() as Mehrdad suggested...
Also, make sure your packets are UNDER 1024 bytes in size, or you will NOT get them.  Took me a while to figure this one out back when XP came out, and I couldn't figure out why my code worked on 2000, but not XP...  Even though send (sendto) would return success, it never actually SENT the packet..
Anyways, I've dealt with UDP a lot on Win32, so if you give me some example code I should be able to help more...
But anyways, check that ALL your variables are initialized to some sort of default value on both the sender and the receiver, (which is just good practice), and then re-build it and try again.  Also, check your packet size with a sizeof() before it sends, and if it's greater than 1024 bytes, don't bother...  It's also a good idea to check size of the received packet, and if it's not exactly the size you expect, then drop the packet.  This holds MORE true for broadcasts, but still applies.
Let me know if any of this helped, I posted a LOT of UDP code on another question here a little while back, and that code works, you might want to refer to it.  

