• Print

Author Topic: 'exe files produced by QB64 do work in Windows 98' is a lie!!!  (Read 607 times)

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #15 on: January 08, 2013, 03:36:42 PM »
At least one for each Visual Studio version, including service packs... I don't know which one is best.
VC++ 2005 RTM (8.0) is the last to target Win 98.
VC++ 2008 SP1 (9.0) is the last to target Win 2000 SP4.

Note that that suggestion was a "third option". Using 0.960 (the first option), or upgrading the mingw of 0.954 (the second option), would be preferable.

Regards,
Michael
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #16 on: January 08, 2013, 03:42:20 PM »
I just want to see if I can run a program. I don't want to compile anything on the 98. Qbasic still works on it.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #17 on: January 08, 2013, 05:29:34 PM »
Quote from: Clippy on January 08, 2013, 03:42:20 PM
I just want to see if I can run a program. I don't want to compile anything on the 98. Qbasic still works on it.

Okay, but you will still probably need to deal with the GetConsoleProcessList problem.

Change it to:
Code: [Select]
// if (GetConsoleProcessList(plist,256)==1){
console_child=1;
FreeConsole();
AllocConsole();
// }

On 0.954, it starts on line 27435 of libqbx.cpp. You will need to run makelib.bat after the change.
On 0.960, it starts on line 28165 of libqb.cpp. You might need to run purge_precompiled_content.bat after the change. I'm not sure how things work with GL, and I don't currently have enough HDD space to test it.

When done, restore libqbx.cpp or libqb.cpp from backup, and rerun makelib.bat or purge_precompiled_content.bat.

If I feel like it, I might drag out my 98SE computer later...

Regards,
Michael
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #18 on: January 08, 2013, 10:30:28 PM »
I managed to fix the ___lc_codepage_func problem using the instructions mcalkins mentioned but I get a MSVCRT.DLL-_fstat64 error now...I think I'm getting closer to getting a QB64 program to work in Win98.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #19 on: January 09, 2013, 02:31:58 AM »
Evidently, copying msvcr71.dll to the local folder and renaming it to msvcrt.dll does not work. I figured maybe it's because msvcrt.dll is already loaded by other programs, and Windows isn't searching for it, so I added a "hello.exe.local" file to the folder, but that didn't work either. So, we're back to hacking the .idata section.

Please try this:

Backup your existing qbx.cpp and libqb.cpp.

In qbx.cpp:

change:
Code: [Select]
GetDefaultPrinter(szPrinterName,&dwNameLen);to:
Code: [Select]
//GetDefaultPrinter(szPrinterName,&dwNameLen);
In libqb.cpp:

change:
Code: [Select]
GetDefaultPrinter(szPrinterName,&dwNameLen);to:
Code: [Select]
//GetDefaultPrinter(szPrinterName,&dwNameLen);
change:
Code: [Select]
if (GetConsoleProcessList(plist,256)==1){
console_child=1;
FreeConsole();
AllocConsole();
}
to:
Code: [Select]
/*if (GetConsoleProcessList(plist,256)==1){
console_child=1;
FreeConsole();
AllocConsole();
}*/

Run purge_precompiled_content.bat.

Compile your hello world program.

Now, use a hex editor or binary file editor of some kind to edit hello.exe. Change the 2 occurrences of msvcrt.dll to zsvcrt.dll. Note that depending on how your hex/binary editor wraps the text, the name might be split. For example if you use edit /64, "msvc" might appear on one line, and "rt.dll" might appear on the next.

Copy hello.exe to your Windows 98SE computer. Copy one of the numbered msvcr##.dll files to the same folder as zsvcrt.dll. Try running hello.exe.

When I try this on mine, using msvcr71.dll, I get an illegal instruction at 0x40131a. This is:
cmovz ecx, ebx
which is a Pentium Pro instruction. I have a Pentium I MMX...

When you're done, restore your backed up qbx.cpp and libqb.cpp, and run purge_precompiled_content.bat.

Please let me know how it turns out.

Regards,
Michael

P.S. It is possible to tell mingw to use a numbered msvcr##.dll file instead of msvcrt.dll, by using a spec file. However, I personally find it slightly intimidating. http://www.mingw.org/wiki/SpecsFileHOWTO

P.S. The above indicated changes probably break LPRINT.
« Last Edit: January 09, 2013, 02:56:06 AM by mcalkins »
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #20 on: January 09, 2013, 04:25:14 AM »
Quote from: mcalkins on January 09, 2013, 02:31:58 AM
Evidently, copying msvcr71.dll to the local folder and renaming it to msvcrt.dll does not work. I figured maybe it's because msvcrt.dll is already loaded by other programs, and Windows isn't searching for it, so I added a "hello.exe.local" file to the folder, but that didn't work either. So, we're back to hacking the .idata section.

Please try this:

Backup your existing qbx.cpp and libqb.cpp.

In qbx.cpp:

change:
Code: [Select]
GetDefaultPrinter(szPrinterName,&dwNameLen);to:
Code: [Select]
//GetDefaultPrinter(szPrinterName,&dwNameLen);
In libqb.cpp:

change:
Code: [Select]
GetDefaultPrinter(szPrinterName,&dwNameLen);to:
Code: [Select]
//GetDefaultPrinter(szPrinterName,&dwNameLen);
change:
Code: [Select]
if (GetConsoleProcessList(plist,256)==1){
console_child=1;
FreeConsole();
AllocConsole();
}
to:
Code: [Select]
/*if (GetConsoleProcessList(plist,256)==1){
console_child=1;
FreeConsole();
AllocConsole();
}*/

Run purge_precompiled_content.bat.

Compile your hello world program.

Now, use a hex editor or binary file editor of some kind to edit hello.exe. Change the 2 occurrences of msvcrt.dll to zsvcrt.dll. Note that depending on how your hex/binary editor wraps the text, the name might be split. For example if you use edit /64, "msvc" might appear on one line, and "rt.dll" might appear on the next.

Copy hello.exe to your Windows 98SE computer. Copy one of the numbered msvcr##.dll files to the same folder as zsvcrt.dll. Try running hello.exe.

When I try this on mine, using msvcr71.dll, I get an illegal instruction at 0x40131a. This is:
cmovz ecx, ebx
which is a Pentium Pro instruction. I have a Pentium I MMX...

When you're done, restore your backed up qbx.cpp and libqb.cpp, and run purge_precompiled_content.bat.

Please let me know how it turns out.

Regards,
Michael

P.S. It is possible to tell mingw to use a numbered msvcr##.dll file instead of msvcrt.dll, by using a spec file. However, I personally find it slightly intimidating. http://www.mingw.org/wiki/SpecsFileHOWTO

P.S. The above indicated changes probably break LPRINT.

I still get 'The LIBSTDC++6.DLL file is linked to missing export MSVCRT.DLL-_fstat64' error...Not sure what to do with this one.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

HACKER

  • Limited Member
  • Hero Member
  • *
  • Posts: 761
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #21 on: January 09, 2013, 05:05:54 AM »
Again! Why don't You use Linux & Wine!?  ::)

You may get QB64 To Work in Win-98 ? But that Won't be Your Biggest Problem if You are Connected to the Internet!...

Windows 98 is Notoriously Unsafe!! On line! it's a CRACKERS! Dream System to get into! Please Take Note!!



H.

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #22 on: January 09, 2013, 06:30:28 AM »
Quote from: HACKER on January 09, 2013, 05:05:54 AM
Again! Why don't You use Linux & Wine!?  ::)

You may get QB64 To Work in Win-98 ? But that Won't be Your Biggest Problem if You are Connected to the Internet!...

Windows 98 is Notoriously Unsafe!! On line! it's a CRACKERS! Dream System to get into! Please Take Note!!



H.

Ah shut up!!! >:( The reason why I want to get QB64 to work in Win98 is not for online networking purposes which you're probably thinking but to see if OpenGL will work on it for old school reasons. :P Anyways, my old Win98 machine comes nicely equipped for such a test (S3 Savage 4 32MB PCI, 256MB RAM, Pentium III 450MHz).

When I make an online web server, I'll just build a new PC out of the old computer components lying around in my dad's shop and use linux for such a purpose because I know that Windows might unexpectedly crash when doing a 24/7 server run...The only biggest problems I would encounter when maintaining a home-based server is power failures and stupid slow and irritable ISPs (our connections only go up to 100-200KB/s max...tends to drop to 5-40KB/s sometimes and time-outs are abundant which is annoying).
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

HACKER

  • Limited Member
  • Hero Member
  • *
  • Posts: 761
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #23 on: January 09, 2013, 06:42:10 AM »
Don't be So Polite Jobert14  ;D ...You May get a Smack from Your Mummy & Stop Your Sweety's for a Week!!


H

HACKER

  • Limited Member
  • Hero Member
  • *
  • Posts: 761
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #24 on: January 09, 2013, 07:41:38 AM »
Last Try to Help You Jobert14...

http://en.utilidades-utiles.com/download-windows-98.html



H.

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #25 on: January 09, 2013, 06:24:20 PM »
Jobert14: Sorry, I should have been clearer. Please try the instructions in my last post with QB64 GL 0.960.

Clippy, have you had any success?

Regards,
Michael
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #26 on: January 09, 2013, 06:50:22 PM »
No I got sidelined on something else. I thought somebody else was going to try so I'm waiting to see what happens.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #27 on: January 09, 2013, 10:20:28 PM »
Quote from: mcalkins on January 09, 2013, 06:24:20 PM
Jobert14: Sorry, I should have been clearer. Please try the instructions in my last post with QB64 GL 0.960.

Clippy, have you had any success?

Regards,
Michael

I managed to fix the __lc_codepage_func problem by following the instructions you posted in http://www.qb64.net/forum/index.php?topic=5573.0 but I get a 'The LIBSTDC++6.DLL file is linked to missing export MSVCRT.DLL-_fstat64' error which I think I'm getting closer to getting it to work...I  then followed your instructions you posted here thoroughly and still get the same error message.
I'll test it again with QB64-GL v0.960 this time and see what happens (I used QB64 v0.954 in my first test).

I think the error is something to do with the Win64 support detection.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #28 on: January 09, 2013, 10:54:14 PM »
Since QB64 GL statically links libstdc++ rather than using the .DLL, you'll only have to hack the executable, not also any .DLL.

Windows 98SE's msvcrt doesn't export _fstat64. (I think that it does export _fstati64.) However, the numbered msvcr##.dll do. So by copying one of them to your local folder, renaming it, and hacking both occurrences of "msvcrt.dll" in the executable's .idata section to use the different name, you should get around that problem.

(It didn't work with when you tried it, because although hello.exe loaded zsvcrt.dll, libstdc++-6.dll was still loading msvcrt.dll. But with 0.960, libstdc++ is statically linked, so you need hack only the executable.)

If you're curious about _fstat64: http://msdn.microsoft.com/en-us/library/221w8e43(v=vs.71).aspx
As far as I know, it doesn't have anything to do with Win64 specifically.

Once you get that done, I expect that your hello world program will at least execute. Whether it will work correctly, I don't know, but all of the .DLL dependencies should be satisfied.

Thank you for being patient and willing to experiment.

Regards,
Michael
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #29 on: January 09, 2013, 11:52:26 PM »
Yay, It finally works!!! :D
I've attached a screen shot showing proof that it works.

I'm not sure if its possible to get QB64 v0.954 to work too. The problem with QB64-GL is that many functions are missing and it seems to be draining every single CPU cycle in my Win98 system maybe because QB64-GL uses a hardware surface and my graphics card does not support 32-bit color hardware surfaces.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

  • Print