unable to compile in Windows 10

Windows specific questions.
fxm
Posts: 9529
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 26, 2015 11:34

jiranz wrote:C:\Freebasic64>fbc -exx myprog.bas
C:\Freebasic64>myprog.exe
Aborting due to runtime error 2 (file not found) at line 1662 of myprog.bas::()
C:\Freebasic64>

1662

Code: Select all

open "logs\" + format$(logyear) + "_activity.log" for append as #11
  print #11,format$(now,"hh:mm:ss ddd dd-mmm yyyy") + space$(2) + logactivity$
  close #11


I suspect it is a false positive (not the real problem) because I commented out that entire section after which I got no further error report in the command but the compiled exe program still would not start .

I suppose that the "logs" folder does not exist in "C:\Freebasic64".
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: unable to compile in Windows 10

Postby MichaelW » Oct 27, 2015 1:42

The data contains c0000409 in several places, which is STATUS_STACK_BUFFER_OVERRUN.
fxm
Posts: 9529
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 27, 2015 7:53

So in a first time, in order to confirm the problem origin (stack overflow), you can try to compile with stack size increase (1024 KBytes per defaut):
Use the compiler option (for example):
-t 2048
or
-t 4096
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 30, 2015 6:07

Tried increasing the stack and other ideas but the exe doesn't run. Needs a rethink. I'll maintain my XP install for now.
Thanks for all the help and suggestions.
St_W
Posts: 1483
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: unable to compile in Windows 10

Postby St_W » Oct 30, 2015 14:39

Just use the 32bit version of the Freebasic compiler until you've identified and solved the compatibility issue(s). That works also on a 64-bit version of Windows.
Or doesn't the 32-bit one work either?
fxm
Posts: 9529
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 30, 2015 15:33

I understood that program does never run, either compiled in 32-bit or in 64-bit, because of Win10 (and that works in 32-bit with WinXP).
I suppose your program is to big or complex so that we could help you to find the bug (as I think that the bug exists).
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 30, 2015 18:25

I can compile in XP 32 and the exe will run in Win10 64 with no problems. It is my program that has a bug that prevents it compiling in Win 10 environment in 32 bit or 64 bit but I am not clever enough to know what is the problem.

It is important program to my family and is in use every day. It runs on our server and can be accessed over local network from all cities where our family now expand to living. At the beginning it was written in AmigaBasic (about 1990) then Amiga Company collapsed and we had to port to IBM PC so it was converted to VBDOS 1.0 then to FreeBasic 015. Next it was changed to later versions of FB 32 bit but many coding invention changes made by trial and error method to adapt original database structure to continue working since AmigaBasic. I think if you are expert coders then you will not like how I made everything work! I have no structure and I just do enough to make it work often without understanding, but it is not pretty! Here in this forum previously we had many discussions about how to change my code to allow database changes from 16 bit to 32 bit. Now I think my unique code inventions have trapped me finally in Windows 10 environment next major development change trying to migrate to 64 bit!

How can I discover where is the main issue (buggy code)? I think maybe all my code will be one big bug mess!
fxm
Posts: 9529
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 30, 2015 19:15

To clarify (If I understood correctly):
- fbc (32-bit or 64-bit) compiles your program without error in Win10 and the object file *.exe is generated, but only at the execution time, you obtain this bad behavior.
- fbc (32-bit) compiles your program without error in WinXP, and the execution works normally.
- The compiled program in WinXP works normally in Win10.

Conversely, have you tried to execute in WinXP the program compiled (with fbc 32-bit) in Win10?
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 31, 2015 0:24

It is possibly a problem with how Windows 10 reads the paths to files in FB

I made a breakthrough by accident and tried some experiments:
Mostly I replaced all relative and mapped paths in myprog.bas with network server paths.
I did not make any other changes.
Next I deleted all previous Freebasic folders and made fresh new installs of FB32 and FB64 in my Windows 10 root

Folder = C\:Freebasic32
fbc myprog.bas
It now compiles OK and the 32 version exe runs with no problems! (so far!)

Folder = C:\Freebasic64
fbc myprog.bas
It does not compile but now CMD reports problem with the paths.
'\\myServer\myFolder'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Could Not Find \\myServer\myFolder\myFile

What does it mean (UNC paths are not supported)?
Is this something specific to new features in Win 10x64 or to current version of FB64?
Is it possible to resolve this problem?
(But of course I am very happy that the FB32 compile is working with myprog.bas!)
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 31, 2015 1:16

I found this article https://support.microsoft.com/en-us/kb/156276 which says it is a known bug in CMD.exe and offers a registry edit to fix it
Obtain the updated Cmd.exe. You must also make a registry entry to be able to use a UNC path as the current directory.
Under the registry path:
HKEY_CURRENT_USER
\Software
\Microsoft
\Command Processor
add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex).

Microsoft has confirmed this to be a problem in Windows NT version 4.0. This problem was corrected in the latest Microsoft Windows NT 4.0 U.S. Service Pack


Isn't this a old advice? I did what the article said and now myprog.bas will compile with no warnings.
But when I run myprog.exe it fails
Could Not Find \\myServer\myFolder\myFile
So it is the same issue.
Does this mean that Win10 has been shipped with an out of date (32) CMD.exe and where is the new (64) version?
I guess I may not be seeing this clearly and it could be a different issue altogether..

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests