unable to compile in Windows 10

Windows specific questions.
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

unable to compile in Windows 10

Postby jiranz » Oct 24, 2015 23:31

I moved from XP to 10. I skipped 7,8,etc. I have kept dual boot option in Windows 10 so can switch back to xp for now. All my programs that are compiled in XP work ok in Windows 10 but I can not get anything to compile in Windows 10. I get a popup that says FBTemp.exe and FBidetemp.exe have stopped working. I have tried both 32 and 64 versions of the compiler but maybe there is something I am doing wrong. I am not an advanced programmer. Is there a solution?
srvaldez
Posts: 2330
Joined: Sep 25, 2005 21:54

Re: unable to compile in Windows 10

Postby srvaldez » Oct 25, 2015 1:06

I just recently installed fb on my windows 10 PC and had no problems, but what I do is to install in c:\dev\FreeBASIC to avoid problems
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 25, 2015 7:13

Since getting your reply I have created a new folder on the root drive called Freebasic64 into which I unzipped FreeBASIC-1.04.0-win64 and FBIde0.4.6r4
Next I copied a myprog.BAS file into the same folder.
In Win XP SP3 the 32 bit compiled version myprog.EXE runs correctly also in Win10.
In Win10 F9 in FBIDE compiles the bas file but a popup window appears "myprog.exe has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available - close program" . I then get a black window with a flashing cursor top left.

There may be something other required when compiling in Windows 10?
fxm
Posts: 9554
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 25, 2015 8:11

Have you a warning message when you compile under Win10 (as "warning 23(2): Array too large for stack")?
I get this kind of Windows message ("program.exe has stopped working") since I have passed from WinXP to Win7.
Often it is linked with a system stack overflow.
(workaround for example: change the 'Dim' of a big array into a 'Dim Shared' or 'Redim').
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 25, 2015 8:29

No warnings.

Just out of curiosity I setup a 32 bit Freebasic folder in Windows 10 and repeated the exercise with exactly the same result.
The popup indicates it must be a Windows issue?
I have researched permissions as much as I understand these things and tried a few suggestions but am no further ahead.

The results above relate to compiling with FBIDE F9 key. If I try the F5 key it reports that FBIDETEMP.exe stopped.
If I try with FBEDIT it says FBTEMP.exe was stopped.
If I try directly fbc myprog.bas then myprog.exe could not start.

Thanks for any ideas.
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 25, 2015 8:49

Some progress - I pulled out an old BAS program I wrote over 10 years ago (16 bit days) and it compiles OK. So it has to be my coding. Now I have to figure out what in my code is causing the problem. It must be something that FB 32 did ok in XP that Windows 10 64 will not tolerate. I have tried the DIM suggestion but it didn;t seem to make a difference.

Maybe I need another include file.
I use #lang "fblite" and #include "vbcompat.bi" at the top of every bas file because they allowed my crude programmng to actually work up until xp. Do I have to consider rewriting new code for compatibility in Windows 10. Oh Boy I hope not because of the drama I had going from 16 to 32 bit!
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: unable to compile in Windows 10

Postby dkl » Oct 25, 2015 10:12

Maybe it's just a matter of making the code compatible to 64bit, i.e. eliminate 32bit assumptions. For example, sizeof(any ptr) and sizeof(integer) becomes 8, and thus pointers can't be stored into 4-byte Long variables anymore, and Integers don't correspond to 32bit pixels anymore. The exact issues varies between program though - it depends on your code.
fxm
Posts: 9554
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 25, 2015 10:24

jiranz wrote:Just out of curiosity I setup a 32 bit Freebasic folder in Windows 10 and repeated the exercise with exactly the same result.

I though have understood that he has also installed a fbc version 32-bit and obtained the same bad behavior?
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: unable to compile in Windows 10

Postby dkl » Oct 25, 2015 11:01

Oh ok, in that case, it's probably not a 64bit porting issue.
fxm
Posts: 9554
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 25, 2015 11:20

I think that even always under 32-bit, the compiled file (.exe) is different depending on usage of fbc with WinXP or Win10.
So a bug previously dormant under WinXP can wake up under Win10!

Can you try to compile with option '-exx' to detect eventual runtime error?
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 25, 2015 19:49

Can you try to compile with option '-exx' to detect eventual runtime error?


At the command prompt:
C:\Freebasic64>fbc -exx myprog.bas
C:\Freebasic64>

It produces the myprog.exe with no popup errors but the program will not run.
Should there be a runtime error file somewhere that could indicate where the problem exists?
fxm
Posts: 9554
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: unable to compile in Windows 10

Postby fxm » Oct 25, 2015 20:13

Have you try then to execute it from the command prompt:
C:\Freebasic64>fbc -exx myprog.bas
C:\Freebasic64>myprog.exe
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: unable to compile in Windows 10

Postby MichaelW » Oct 25, 2015 20:38

If your program is failing, you can get an idea of what is happening from the system event logs. I don't have Windows 10, but in Windows 8.1, 7, XP and 2000, you go to Control Panel->Administrative Tools->Event Viewer. Your app is probably triggering an exception, likely an access violation exception where the exception code will show as 0xC0000005. You can find a listing of the codes in winnt.bi:

Code: Select all

...
#define STATUS_GUARD_PAGE_VIOLATION cast(DWORD, &h80000001)
#define STATUS_DATATYPE_MISALIGNMENT cast(DWORD, &h80000002)
#define STATUS_BREAKPOINT cast(DWORD, &h80000003)
#define STATUS_SINGLE_STEP cast(DWORD, &h80000004)
#define STATUS_LONGJUMP cast(DWORD, &h80000026)
#define STATUS_UNWIND_CONSOLIDATE cast(DWORD, &h80000029)
#define DBG_EXCEPTION_NOT_HANDLED cast(DWORD, &h80010001)
#define STATUS_ACCESS_VIOLATION cast(DWORD, &hC0000005)
#define STATUS_IN_PAGE_ERROR cast(DWORD, &hC0000006)
#define STATUS_INVALID_HANDLE cast(DWORD, &hC0000008)
#define STATUS_INVALID_PARAMETER cast(DWORD, &hC000000D)
#define STATUS_NO_MEMORY cast(DWORD, &hC0000017)
#define STATUS_ILLEGAL_INSTRUCTION cast(DWORD, &hC000001D)
#define STATUS_NONCONTINUABLE_EXCEPTION cast(DWORD, &hC0000025)
#define STATUS_INVALID_DISPOSITION cast(DWORD, &hC0000026)
#define STATUS_ARRAY_BOUNDS_EXCEEDED cast(DWORD, &hC000008C)
#define STATUS_FLOAT_DENORMAL_OPERAND cast(DWORD, &hC000008D)
#define STATUS_FLOAT_DIVIDE_BY_ZERO cast(DWORD, &hC000008E)
#define STATUS_FLOAT_INEXACT_RESULT cast(DWORD, &hC000008F)
#define STATUS_FLOAT_INVALID_OPERATION cast(DWORD, &hC0000090)
#define STATUS_FLOAT_OVERFLOW cast(DWORD, &hC0000091)
#define STATUS_FLOAT_STACK_CHECK cast(DWORD, &hC0000092)
#define STATUS_FLOAT_UNDERFLOW cast(DWORD, &hC0000093)
#define STATUS_INTEGER_DIVIDE_BY_ZERO cast(DWORD, &hC0000094)
#define STATUS_INTEGER_OVERFLOW cast(DWORD, &hC0000095)
#define STATUS_PRIVILEGED_INSTRUCTION cast(DWORD, &hC0000096)
#define STATUS_STACK_OVERFLOW cast(DWORD, &hC00000FD)
#define STATUS_DLL_NOT_FOUND cast(DWORD, &hC0000135)
#define STATUS_ORDINAL_NOT_FOUND cast(DWORD, &hC0000138)
#define STATUS_ENTRYPOINT_NOT_FOUND cast(DWORD, &hC0000139)
#define STATUS_CONTROL_C_EXIT cast(DWORD, &hC000013A)
#define STATUS_DLL_INIT_FAILED cast(DWORD, &hC0000142)
#define STATUS_FLOAT_MULTIPLE_FAULTS cast(DWORD, &hC00002B4)
#define STATUS_FLOAT_MULTIPLE_TRAPS cast(DWORD, &hC00002B5)
#define STATUS_REG_NAT_CONSUMPTION cast(DWORD, &hC00002C9)
#define STATUS_STACK_BUFFER_OVERRUN cast(DWORD, &hC0000409)
#define STATUS_INVALID_CRUNTIME_PARAMETER cast(DWORD, &hC0000417)
#define STATUS_ASSERTION_FAILURE cast(DWORD, &hC0000420)
#define STATUS_SXS_EARLY_DEACTIVATION cast(DWORD, &hC015000F)
#define STATUS_SXS_INVALID_DEACTIVATION cast(DWORD, &hC0150010)
...
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 26, 2015 0:53

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 .
jiranz
Posts: 73
Joined: Sep 22, 2006 3:56
Location: New Zealand

Re: unable to compile in Windows 10

Postby jiranz » Oct 26, 2015 1:37

I think this might be the windows error reports why it does not run after compiling in Windows 10. Sorry if it is a bit long but I tried to find everything that might be relevant in the Events Log section.

I don't know how to read this information. Can anyone tell me if this reveals something that can be worked through?

I am also puzzled why the Reports at the bottom of this list say this is faulting on Windows 8 because I have a genuine Windows 10 clean install and have never had Windows 8 ever.

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-10-26T00:48:00.000000000Z" />
<EventRecordID>1817</EventRecordID>
<Channel>Application</Channel>
<Computer>iHub</Computer>
<Security />
</System>
- <EventData>
<Data>myprog.exe</Data>
<Data>0.0.0.0</Data>
<Data>562d7840</Data>
<Data>ntdll.dll</Data>
<Data>10.0.10240.16430</Data>
<Data>55c59f92</Data>
<Data>c0000409</Data>
<Data>0000000000089cb7</Data>
<Data>658</Data>
<Data>01d10f87f69a67a2</Data>
<Data>C:\Freebasic64\myprog.exe</Data>
<Data>C:\Windows\SYSTEM32\ntdll.dll</Data>
<Data>312c61e7-0855-4430-831f-2a15ce336e07</Data>
<Data />
<Data />
</EventData>
</Event>

then this...

Log Name: Application
Source: Windows Error Reporting
Date: 26/10/2015 1:33:20 PM
Event ID: 1001
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Computer: iHub
Description:
Fault bucket 116040861605, type 5
Event Name: BEX64
Response: Not available
Cab Id: 0

Problem signature:
P1: myprog.exe
P2: 0.0.0.0
P3: 562d74ba
P4: ntdll.dll
P5: 10.0.10240.16430
P6: 55c59f92
P7: 0000000000089cb7
P8: c0000409
P9: 0000000000000001
P10:

Attached files:
C:\Users\User\AppData\Local\Temp\WER61AE.tmp.WERInternalMetadata.xml
C:\Users\User\AppData\Local\Temp\WER6D57.tmp.appcompat.txt
memory.hdmp

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_myprog.exe_606b276261c68220609f5eca26f8a63d5e3a31_38210773_0bd67a08

Analysis symbol:
Rechecking for solution: 0
Report Id: 52d1ad9e-f31c-49d6-bb57-8513278294c4
Report Status: 4104
Hashed bucket: 35565c78a182591707b95c6fac729bb6
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Windows Error Reporting" />
<EventID Qualifiers="0">1001</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-10-26T00:33:20.000000000Z" />
<EventRecordID>1816</EventRecordID>
<Channel>Application</Channel>
<Computer>iHub</Computer>
<Security />
</System>
<EventData>
<Data>116040861605</Data>
<Data>5</Data>
<Data>BEX64</Data>
<Data>Not available</Data>
<Data>0</Data>
<Data>myprog.exe</Data>
<Data>0.0.0.0</Data>
<Data>562d74ba</Data>
<Data>ntdll.dll</Data>
<Data>10.0.10240.16430</Data>
<Data>55c59f92</Data>
<Data>0000000000089cb7</Data>
<Data>c0000409</Data>
<Data>0000000000000001</Data>
<Data>
</Data>
<Data>
C:\Users\User\AppData\Local\Temp\WER61AE.tmp.WERInternalMetadata.xml
C:\Users\User\AppData\Local\Temp\WER6D57.tmp.appcompat.txt
memory.hdmp</Data>
<Data>C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_myprog.exe_606b276261c68220609f5eca26f8a63d5e3a31_38210773_0bd67a08</Data>
<Data>
</Data>
<Data>0</Data>
<Data>52d1ad9e-f31c-49d6-bb57-8513278294c4</Data>
<Data>4104</Data>
<Data>35565c78a182591707b95c6fac729bb6</Data>
</EventData>
</Event>

Report why FBIDETEMP.EXE fails to start...

Version=1
EventType=BEX64
EventTime=130902887438161325
ReportType=2
Consent=1
UploadTime=130902887438942571
ReportIdentifier=c77adcc7-7b6e-11e5-9be2-002618bee9b3
IntegratorReportIdentifier=a9283658-1612-47f6-a400-49d4b8082006
NsAppName=FBIDETEMP.exe
Response.BucketId=94887c65c2ee9e4531aab250918be3e3
Response.BucketTable=5
Response.LegacyBucketId=116040839615
Response.type=4
Response.CabId=116007849312
Sig[0].Name=Application Name
Sig[0].Value=FBIDETEMP.exe
Sig[1].Name=Application Version
Sig[1].Value=0.0.0.0
Sig[2].Name=Application Timestamp
Sig[2].Value=562d6366
Sig[3].Name=Fault Module Name
Sig[3].Value=ntdll.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=10.0.10240.16430
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=55c59f92
Sig[6].Name=Exception Offset
Sig[6].Value=0000000000089cb7
Sig[7].Name=Exception Code
Sig[7].Value=c0000409
Sig[8].Name=Exception Data
Sig[8].Value=0000000000000001
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.10240.2.0.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=5129
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=3b09
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=3b093a686b74fd42d20818f97998a173
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=4df1
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=4df1f7d749cf6780eb78e3c5f7672ca7
UI[2]=C:\Freebasic64\FBIDETEMP.exe
UI[3]=FBIDETEMP.exe has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Freebasic64\FBIDETEMP.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\system32\KERNEL32.DLL
LoadedModule[3]=C:\Windows\system32\KERNELBASE.dll
LoadedModule[4]=C:\Windows\system32\msvcrt.dll
LoadedModule[5]=C:\Windows\system32\USER32.dll
LoadedModule[6]=C:\Windows\system32\GDI32.dll
LoadedModule[7]=C:\Windows\system32\IMM32.DLL
LoadedModule[8]=C:\Windows\system32\MSCTF.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
File[0].CabName=WERInternalMetadata.xml
File[0].Path=WER7A42.tmp.WERInternalMetadata.xml
File[0].Flags=851971
File[0].Type=5
File[0].Original.Path=C:\Users\User\AppData\Local\Temp\WER7A42.tmp.WERInternalMetadata.xml
File[1].CabName=triagedump.dmp
File[1].Flags=808255491
File[1].Type=6
File[2].CabName=WERDataCollectionFailure.txt
File[2].Path=WER864B.tmp.WERDataCollectionFailure.txt
File[2].Flags=851971
File[2].Type=5
File[2].Original.Path=C:\Users\User\AppData\Local\Temp\WER864B.tmp.WERDataCollectionFailure.txt
File[3].CabName=Report.cab
File[3].Path=Report.cab
File[3].Flags=196608
File[3].Type=11
File[3].Original.Path=Report.cab
FriendlyEventName=Stopped working
ConsentKey=BEX64
AppName=FBIDETEMP.exe
AppPath=C:\Freebasic64\FBIDETEMP.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=C70AC5FDD14C294E1FA6630B992C7E03

Why myprog.exe crashes...

Version=1
EventType=BEX64
EventTime=130902940803948717
ReportType=2
Consent=1
UploadTime=130902940804663815
ReportIdentifier=34534241-7b7b-11e5-9be2-002618bee9b3
IntegratorReportIdentifier=312c61e7-0855-4430-831f-2a15ce336e07
NsAppName=myprog.exe
Response.BucketId=d08fd6568056f685bf0f385cdf83735f
Response.BucketTable=5
Response.LegacyBucketId=116040866512
Response.type=4
Response.CabId=116007870654
Sig[0].Name=Application Name
Sig[0].Value=myprog.exe
Sig[1].Name=Application Version
Sig[1].Value=0.0.0.0
Sig[2].Name=Application Timestamp
Sig[2].Value=562d7840
Sig[3].Name=Fault Module Name
Sig[3].Value=ntdll.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=10.0.10240.16430
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=55c59f92
Sig[6].Name=Exception Offset
Sig[6].Value=0000000000089cb7
Sig[7].Name=Exception Code
Sig[7].Value=c0000409
Sig[8].Name=Exception Data
Sig[8].Value=0000000000000001
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.10240.2.0.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=5129
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=1962
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=1962c3f1a2419ae7f2292964e9e9be62
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=5506
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=5506eea8d8364d5700b1e276ff4d287f
UI[2]=C:\Freebasic64\myprog.exe
UI[3]=myprog.exe has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Freebasic64\myprog.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\system32\KERNEL32.DLL
LoadedModule[3]=C:\Windows\system32\KERNELBASE.dll
LoadedModule[4]=C:\Windows\system32\msvcrt.dll
LoadedModule[5]=C:\Windows\system32\USER32.dll
LoadedModule[6]=C:\Windows\system32\GDI32.dll
LoadedModule[7]=C:\Windows\system32\IMM32.DLL
LoadedModule[8]=C:\Windows\system32\MSCTF.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
File[0].CabName=WERInternalMetadata.xml
File[0].Path=WERE844.tmp.WERInternalMetadata.xml
File[0].Flags=851971
File[0].Type=5
File[0].Original.Path=C:\Users\User\AppData\Local\Temp\WERE844.tmp.WERInternalMetadata.xml
File[1].CabName=triagedump.dmp
File[1].Flags=808255491
File[1].Type=6
File[2].CabName=WERDataCollectionFailure.txt
File[2].Path=WERF43D.tmp.WERDataCollectionFailure.txt
File[2].Flags=851971
File[2].Type=5
File[2].Original.Path=C:\Users\User\AppData\Local\Temp\WERF43D.tmp.WERDataCollectionFailure.txt
File[3].CabName=Report.cab
File[3].Path=Report.cab
File[3].Flags=196608
File[3].Type=11
File[3].Original.Path=Report.cab
FriendlyEventName=Stopped working
ConsentKey=BEX64
AppName=myprog.exe
AppPath=C:\Freebasic64\myprog.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=F1E7AE649CFB85B8AECC2116963C28E7

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 5 guests