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__
In wxCompile.nim of wxnim, the code
const wxConfig = "wx-config"
{.passC: "`" & wxConfig & " --cppflags`".}
{.passL: "`" & wxConfig & " --libs`".}
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`'
Although it is not right but we can find the passC and passL actually pass the string to compiler
After reading doc, I change the code in wxCompile.nim of wxnim to
const wxConfig = "wx-config"
{.passC: gorge(wxConfig & " --cppflags").}
{.passL: gorge(wxConfig & " --libs all").}
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.
as you can find, passC and passL are not passed to g++
So why and what is the proper code here? Thanks