Skip to main content
gamedev.net
🔒 Locked

Weird executable behavior?

Started by el conquist Feb 16, 2005 at 7:21 PM 10 replies 1.6k views
Original Post
el conquist
el conquist
I have an application that whenever I run inside of my compiler it works fine. (It's a network app, and in this case it connects to my server just fine) But if I take the built executable (WITHOUT changes to the code) and run it, (by simply double clicking the app, not by pressing the Run button in my compiler) it fails to connect to the server. Nothing else has changed at all. I'm using: Visual Studio C++ 2005 Express Edition Beta (Whidbey) XP Home SP2 3.0GHz P4 /w HT Any insight would be well appreciated!
Mastaba
Mastaba
When you say nothing else has changed at all, you are probably mistaken. Something else has probably changed, that being the working directory.
el conquist
el conquist
How would changing the working directory affect the way program connects to my server? I mean, everything else works fine.
Radan
Radan
well, are you using any external files, or is it just an exe.
-----------------Always look on the bright side of Life!
corrington_j
corrington_j
I had a problem just like this a while ago, and people thought i was crazy. It wasn't networking related however, so i don't know how much this will help. What ended up being the cause were dynamic arrays that I had not set to 0. When i ran release mode visual studio must have been zeroing them, so when i ran the exe it didn't work because they were not zeroed. If you want to run from VS like the exe then do run without debugging. Apparently release mode still does some things differently than the exe.
el conquist
el conquist
@A Guy from CRO: I'm using external files, but I have included them inside the directory where the program is located, and the program recognizes them fine.

@corrington_j: I'll try running it without debugging and see if that works.



Thanks for the replies!
corrington_j
corrington_j
remember, its not release mode, its under debug menu, and then click start without debugging. When I had my issue it drove me nuts for about 2 weeks trying to figure out what was going on.
chollida1
chollida1
If you get bugs where running it in the debugger wont reproduce the crash then most likely the problem is an uninitialized value. The debugger always initializes values, running a release version outside of the debuger won't.

Cheers
Chris
CheersChris
el conquist
el conquist
well, it wasnt ever crashing, its just that the listen() function would never work, unless it ran from the compiler.

and its only the listen function, everything else works smoothly. any suggestions?
Solias
Solias
You could start the app and then attach a debugger while it is running, assuming the bug still occurs in this case you might be able to get some more information. If not then you are going to need to add some logging to track the problem down.
corrington_j
corrington_j
I don't anything about what you are working on, but is it possible the listen function is using some data that wasn't initialized when just running the exe.
corrington_j
corrington_j
I don't know anything about what you are working on, but is it possible the listen function is using some data that wasn't initialized when just running the exe.

[Edited by - corrington_j on February 17, 2005 7:49:07 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.