I use nim in MSYS2+Mingw64 on Windows 7 64 bits.

The involved code can be download 
[here](https://forums.wxwidgets.org/viewtopic.php?f=27&t=45513) which uses 
[wxnim](https://github.com/PMunch/wxnim) . And I have stated the [details to 
compile wxWidgets](https://github.com/PMunch/wxnim/issues/12)

**First of all**

I can compile and run the [CPP version by 
PB](https://forums.wxwidgets.org/viewtopic.php?f=27&t=45513), no matter with 
    
    
    g++ -Os `(/opt/windows_64/bin/wx-config --cflags)` test.cpp 
`(/opt/windows_64/bin/wx-config --libs all)`
    
    
    Run

or 
    
    
    g++ `(/opt/windows_64/bin/wx-config --cflags)` test.cpp 
`(/opt/windows_64/bin/wx-config --libs all)`
    
    
    Run

**Then for the nim code**

I use 
    
    
    $ nim
    Nim Compiler Version 0.19.9 [Windows: amd64]
    Compiled at 2019-01-28
    Copyright (c) 2006-2018 by Andreas Rumpf
    
    
    Run

$ nim cpp -r -d:release --passL:-s --opt:size example2.nim| the EXE runs 
without crash  
---|---  
$ nim cpp -r -d:release --passL:-s example2.nim| the EXE runs and crash  
$ nim cpp -r -d:release --opt:size example2.nim| the EXE runs without crash  
$ nim cpp -r -d:release example2.nim| the EXE runs and crash  
  
all the crashes says 
    
    
    SIGSEGV: Illegal storage access. (Attempt to read from nil?)
    Error: execution of an external program failed: 
'C:\Users\USER\.nimble\pkgs\wxnim-0.8.0\examples\purewx\example2.exe '
    
    
    Run

of cause, all the EXE files have different file size.

so what is the problem and how to fix it? Thanks

Reply via email to