on my machine( MSYS2 + MingW64, windows 64bits) 
    
    
    $ wx-config --libs
    -LE:/msys64/mingw64/lib   -pipe -Wl,--subsystem,windows -mwindows 
-lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 
-lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 
-lwx_baseu-3.0
    
    $ wx-config --cppflags
    -IE:/msys64/mingw64/lib/wx/include/msw-unicode-3.0 
-IE:/msys64/mingw64/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL 
-D__WXMSW__
    
    
    Run

In wxCompile.nim of [wxnim](https://github.com/PMunch/wxnim), the code 
    
    
    const wxConfig = "wx-config"
    {.passC: "`" & wxConfig & " --cppflags`".}
    {.passL: "`" & wxConfig & " --libs`".}
    
    
    Run

will not be compiled because the back quote mark: 
    
    
    $ nim cpp -r controlgallery.nim
    
    ...
    Error: execution of an external compiler program 'g++.exe -c  -w 
-mno-ms-bitfields -w -fpermissive -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN 
`wx-config --cppflags`  -IE:\msys64\home\USER\_nim\nim\lib 
-IR:\examples\genuimacro -o 
C:\Users\USER\nimcache\controlgallery_d\stdlib_helpers2.cpp.o 
C:\Users\USER\nimcache\controlgallery_d\stdlib_helpers2.cpp' failed with exit 
code: 1
    
    g++.exe: error: `wx-config: No such file or directory
    g++.exe: error: unrecognized command line option '--cppflags`'
    
    
    Run

Although it is not right but we can find the passC and passL actually pass the 
string to compiler

After reading 
[doc](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passc-pragma),
 I change the code in wxCompile.nim of [wxnim](https://github.com/PMunch/wxnim) 
to 
    
    
    const wxConfig = "wx-config"
    {.passC: gorge(wxConfig & " --cppflags").}
    {.passL: gorge(wxConfig & " --libs all").}
    
    
    Run

but 
    
    
    $ nim cpp -r controlgallery.nim
    
    ...
    
    Error: execution of an external compiler program 'g++.exe -c  -w 
-mno-ms-bitfields -w -fpermissive -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  
-IE:\msys64\home\USER\_nim\nim\lib -IR:\examples\genuimacro -o 
C:\Users\USER\nimcache\controlgallery_d\wxnim_wx.cpp.o 
C:\Users\USER\nimcache\controlgallery_d\wxnim_wx.cpp' failed with exit code: 1
    
    C:\Users\USER\nimcache\controlgallery_d\wxnim_wx.cpp:10:23: fatal error: 
wx/wxprec.h: No such file or directory
     #include <wx/wxprec.h>
                           ^
    compilation terminated.
    
    
    Run

as you can find, passC and passL are not passed to g++

So why and what is the proper code here? Thanks

Reply via email to