Works on 98 but not on XP?

Started by
10 comments, last by GameDev.net 17 years, 10 months ago
I'm currently working on a little game. Well, actually only the GUI's really intact right now. Anyways, it compiles and runs absolutely perfect for me... but whenever I pass it to a friend who has say, Windows XP installed it pukes. And of course since I don't have XP installed, I can't really go around debugging this on my own.
int main(int argc, char** argv)
{
   #ifdef _DEBUG_CLIENT_
      if(argc>1)
      {
         if(!strcmp(argv[1],"debug-mode"))
         {
            error->Debug = true;
         }
      }
   #endif
error->Write("Initializing GLUT...");
That Write at the bottom was a part of others I implemented to see where it was puking for my friend. The thing is, when he ran it the error.txt was created... but nothing got written in it.
void DebugIO::Write(const char* output)
{
   if (!isOpen)Open();
   fprintf(stderr,"%s",output);
}
The Open function basically just redirects stderr to "error.txt", sets the "isOpen" bool to true, and outputs the date (which wasn't even shown). Now is there any difference in possible .DLL's and such that 98 and XP have that would cause a crash using these certain functions? Because like I said it compiles fine, no warning and whatnot, runs perfectly fine except on XP. Any and all help is appreciated. :) -Etyrn
Advertisement
(This could be off base, so take it for what it is)

A few of my books say that programs running on Windows XP can not write into any other folder except My Documents by default - and this is the standard option on XP Home Edition. There are some special function calls which facilitate writing to the appropriate place.
Personally, I've never had a problem with it, but it may be what you're encountering.

Cheers,
--Brian
That'd make sense, but I'm pretty sure that's not it. Since it *used* to write properly. The only change I made to the DebugIO class was that I added if(!isOpen)Open(); to the Write function so I didn't have to do
if(!error->isOpen)error->Open();
error->Write("");
in main or whatever other function would call "Write". I don't really see how that'd screw it over, though.


-Etyrn
This may not help but you could try calling "fflush(FILE *);" after every write to the file, i'm not sure if the buffer would be flushed when your program crashes.

Sorry I don't have anything else to offer.
Quote:Original post by Nairb
(This could be off base, so take it for what it is)

A few of my books say that programs running on Windows XP can not write into any other folder except My Documents by default - and this is the standard option on XP Home Edition. There are some special function calls which facilitate writing to the appropriate place.
Personally, I've never had a problem with it, but it may be what you're encountering.

Cheers,
--Brian


I thought the rule was just that no program is allowed to write anywhere within "Program Files" (or any system folders and such).
Quote:Original post by Smacker_626
This may not help but you could try calling "fflush(FILE *);" after every write to the file, i'm not sure if the buffer would be flushed when your program crashes.


I also go to the trouble with my "catch a crash" log files of closing and re-opening the file for each write, since I've had problems in the past where flushing did not get everything written to disk due to lazy write I/O in the O/S.

Also, you might consider looking into setting up some alternate O/S virtual machines so that you can at least test on a "modern" version of Windows like 2K. You can do this for free (sans nominal ebay O/S price) with the free VMware Player and a bit of googling to figure out how to manually modify the config files and to get VMware Tools to install.
Does this run on another computer with 98 on it? I'd have to guess that you need to redistribute files(probably .dlls) that you aren't aware of and that it won't work on *any* other computer. And what compiler are you using?
Alright!

I tried the fflush, didn't work. Nice idea, though.
As for "not sending everything" my linker has:
-lglut32
-lglu32
-lopengl32
-lwinmm
-lwsock32

And I'm pretty sure out of that the only .DLL I'd need to send is glut32.dll, which I did. Also sent my full graphics folder, but I have self handled errors to test with that. As soon as I get access to another 98 SE computer I'll try there, too. As for my compiler I'm using Dev-C++.

And everyone, thanks for your help. :)


-Etyrn
Windows XP is a lot more fussy than 98 about accessing invalid memory addresses etc. I was working on a platform game a while back on 98 (using devcpp too), and it worked fine, but then I upgraded to XP and it crashed immediately when I ran it. It took me ages to track down all the bugs and get it running in XP. If you are sure that you are including all the necessary DLLs, you should double check your pointer initializations. If at all possible, try to get your friend to let you have a debugging session on XP :D
Aye, I had a feeling it'd come to this. Though the friend mentioned I don't actually know irl... >_> I can always do it on my Dad's uber duber debuggin' compooter, though. Thanks!


-Etyrn

This topic is closed to new replies.

Advertisement