wxHaskell on Windows compilation problems

I’m trying to compile an established wxHaskell application (Ubuntu) on Windows 7 and after a day of frustration, I wanted to see if anyone had some clues. The problem is getting wxc to compile against wxWidgets, where wxWidgets was compiled with MinGHC (GHC 7.8.4). Following are my steps up to trouble: - On 64 bit Win 7, install MinGHC, which ends up in the AppData path. - Grab wxWidgets with git and using MSYS shell compile like: mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release clean mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release with the goal of compiler compatibility. - Setup some environment variables like: C_INCLUDE_PATH == C:\PCRE\include CPLUS_INCLUDE_PATH == C:\Libs\wxWidgets\3.0.2\include LIBRARY_PATH == C:\PCRE\lib;C:\Libs\wxHaskell\3.0.2\\lib\gcc_lib MSYSTEM == MINGW64 WXCFG == gcc_dll\mswu WXWIN == C:\Libs\wxWidgets\3.0.2 PATH = C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\git-2.4.5.1\cmd;C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\git-2.4.5.1\usr\bin;C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\ghc-7.8.4\mingw\bin;C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\ghc-7.8.4\bin;C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\bin;C:\Users\michaeljones\AppData\Roaming\cabal\bin; - Tweak wxUSE_GRAPHICS_CONTEXT - Create sandbox for my project with pointer to a local copy of wxHaskell - Apply a few patches to enable some new table support (stable stuff) - Configure with cabal and compile The first problem is it can’t run wx-config because it looks for a script, so I tweaked the Setup.hs to use the exe and it continues to compile. It gets this error: Building wxc C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\ghc-7.8.4\mingw\bin\gcc.exe -Isrc/include -IC:/Users/michaeljones /Documents/linti/libs/wxHaskell/wxc -IC:/Users/michaeljones/Documents/linti/libs/wxHaskell/wxc -DWXUSINGDLL -D_UNICODE -D__WXDEBUG __ -D__WXMSW__ -DHAVE_W32API_H -DwxcREFUSE_MEDIACTRL -DBUILD_DLL -c src\cpp\apppath.cpp -o dist\dist-sandbox-95204306\build\src/cp p/apppath.o In file included from C:\Libs\wxWidgets\3.0.2\include/wx/defs.h:20:0, from C:\Libs\wxWidgets\3.0.2\include/wx/wx.h:14, from src/include/wrapper.h:20, from src\cpp\apppath.cpp:1: C:\Libs\wxWidgets\3.0.2\include/wx/platform.h:136:22: fatal error: wx/setup.h: No such file or directory compilation terminated. So, I copy the wxWidgets setup.h file from include/msvc/wx to include/wx and compile to a new error: Build log ( C:\Users\michaeljones\Documents\linti\linti-beagle\.cabal-sandbox\logs\wxc-0.92.0.0.log ): Building wxc C:\Users\michaeljones\AppData\Local\Programs\minghc-7.8.4-x86_64\ghc-7.8.4\mingw\bin\gcc.exe -Isrc/include -IC:/Users/michaeljones /Documents/linti/libs/wxHaskell/wxc -IC:/Users/michaeljones/Documents/linti/libs/wxHaskell/wxc -DWXUSINGDLL -D_UNICODE -D__WXDEBUG __ -D__WXMSW__ -DHAVE_W32API_H -DwxcREFUSE_MEDIACTRL -DBUILD_DLL -c src\cpp\apppath.cpp -o dist\dist-sandbox-95204306\build\src/cp p/apppath.o In file included from C:\Libs\wxWidgets\3.0.2\include/wx/platform.h:136:0, from C:\Libs\wxWidgets\3.0.2\include/wx/defs.h:20, from C:\Libs\wxWidgets\3.0.2\include/wx/wx.h:14, from src/include/wrapper.h:20, from src\cpp\apppath.cpp:1: C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:12:6: error: #error "This file should only be included when using Microsoft Visual C++" In file included from C:\Libs\wxWidgets\3.0.2\include/wx/platform.h:136:0, from C:\Libs\wxWidgets\3.0.2\include/wx/defs.h:20, from C:\Libs\wxWidgets\3.0.2\include/wx/wx.h:14, from src/include/wrapper.h:20, from src\cpp\apppath.cpp:1: C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:121:1: error: pasting "/" and "vc_x64_dll" does not give a valid preprocessing token C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:121:1: error: pasting "vc_x64_dll" and "/" does not give a valid preprocessing token C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:121:1: error: pasting "/" and "msw" does not give a valid preprocessing token C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:121:1: error: pasting "mswu" and "/" does not give a valid preprocessing token C:\Libs\wxWidgets\3.0.2\include/wx/setup.h:121:27: fatal error: ../../../lib/vc_x64_dll /mswu /wx/setup.h: No such file or directo I assume the problem is that the wxWidget compilation that comes with makefile.gcc is somehow bypassing some linux based compilation method and not leaving the tree in the proper state for wxHaskell. The Wiki page is based on platform, not MinGHC. I used MinGHC because it got me over problems compiling regex-pcre against libpcre where I failed with cygwin. From reading is appeared MinGHC was a good general path. Note, I had the TDM compiler on the machine, but it was taken out, so there is no accidentally use of the wrong compiler or anything going on. Does anyone have any clues how to make wxHaskell and MinGHC work together? Mike

On Fri, 23 Oct 2015 17:29:03 +0200, Michael Jones
I’m trying to compile an established wxHaskell application (Ubuntu) on Windows 7 : - Grab wxWidgets with git and using MSYS shell compile like:
It is better to download 3.0.2 source code, because wxHaskell cannot handle wxWidgets 3.1 yet. Even better, use a wxInstall package[0]; if you want to install wxHaskell from source on your own disk, instead of from Hackage, do not run the Install.bat.
So, I copy the wxWidgets setup.h file from include/msvc/wx to include/wx
This file should have been generated by mingw32-make; if you use a wxInstall package, you have the right setup.h file.
The Wiki page is based on platform, not MinGHC. : Does anyone have any clues how to make wxHaskell and MinGHC work together?
I tried it, the method described at the HaskellWiki page[1] works for MinGHC as well. Regards, Henk-Jan van Tuyl [0] http://sourceforge.net/projects/wxhaskell/files/wxInstall/ [1] https://wiki.haskell.org/WxHaskell/Windows#Installing_the_hard_way -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

The precompiled version will not support my application due to command line handling issues discussed elsewhere, and a few enhancements to handle very large (100K rows) tables, that are probably not high enough quality to put into the mainline, due to lack of time to make them such. I’ll look at the instructions a bit closer, but at least I know mingw32-make should create the file, so I can focus on that problem first. Thanks, Mike
On Oct 24, 2015, at 8:24 AM, Henk-Jan van Tuyl
wrote: On Fri, 23 Oct 2015 17:29:03 +0200, Michael Jones
wrote: I’m trying to compile an established wxHaskell application (Ubuntu) on Windows 7 : - Grab wxWidgets with git and using MSYS shell compile like:
It is better to download 3.0.2 source code, because wxHaskell cannot handle wxWidgets 3.1 yet. Even better, use a wxInstall package[0]; if you want to install wxHaskell from source on your own disk, instead of from Hackage, do not run the Install.bat.
So, I copy the wxWidgets setup.h file from include/msvc/wx to include/wx
This file should have been generated by mingw32-make; if you use a wxInstall package, you have the right setup.h file.
The Wiki page is based on platform, not MinGHC. : Does anyone have any clues how to make wxHaskell and MinGHC work together?
I tried it, the method described at the HaskellWiki page[1] works for MinGHC as well.
Regards, Henk-Jan van Tuyl
[0] http://sourceforge.net/projects/wxhaskell/files/wxInstall/ [1] https://wiki.haskell.org/WxHaskell/Windows#Installing_the_hard_way
-- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/
http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

Can you give me the revision in GIT that is the official 3.0.2 release so I can branch from it and apply my patch. It just convenient to use git to keep track of my tweaks and have access to the log, etc. If there are some compatible commits since then up to some point where it breaks, I would like to know where things break. Mike
On Oct 24, 2015, at 8:24 AM, Henk-Jan van Tuyl
wrote: On Fri, 23 Oct 2015 17:29:03 +0200, Michael Jones
wrote: I’m trying to compile an established wxHaskell application (Ubuntu) on Windows 7 : - Grab wxWidgets with git and using MSYS shell compile like:
It is better to download 3.0.2 source code, because wxHaskell cannot handle wxWidgets 3.1 yet. Even better, use a wxInstall package[0]; if you want to install wxHaskell from source on your own disk, instead of from Hackage, do not run the Install.bat.
So, I copy the wxWidgets setup.h file from include/msvc/wx to include/wx
This file should have been generated by mingw32-make; if you use a wxInstall package, you have the right setup.h file.
The Wiki page is based on platform, not MinGHC. : Does anyone have any clues how to make wxHaskell and MinGHC work together?
I tried it, the method described at the HaskellWiki page[1] works for MinGHC as well.
Regards, Henk-Jan van Tuyl
[0] http://sourceforge.net/projects/wxhaskell/files/wxInstall/ [1] https://wiki.haskell.org/WxHaskell/Windows#Installing_the_hard_way
-- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/
http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

On Sat, 24 Oct 2015 19:44:05 +0200, Michael Jones
Can you give me the revision in GIT that is the official 3.0.2 release so I can branch from it and apply my patch. It just convenient to use git to keep track of my tweaks and have access to the log, etc. If there are some compatible commits since then up to some point where it breaks, I would like to know where things break.
You can download the wxWidgets 3.0.2 source code from http://www.wxwidgets.org/downloads/ and start a new repository based on that. Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

On Sat, 24 Oct 2015 20:58:18 +0200, Henk-Jan van Tuyl
On Sat, 24 Oct 2015 19:44:05 +0200, Michael Jones
wrote: Can you give me the revision in GIT that is the official 3.0.2 release so I can branch from it and apply my patch. It just convenient to use git to keep track of my tweaks and have access to the log, etc. If there are some compatible commits since then up to some point where it breaks, I would like to know where things break.
You can download the wxWidgets 3.0.2 source code from http://www.wxwidgets.org/downloads/ and start a new repository based on that.
I am sorry, that was not a good answer; I am looking into it. Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

On Sat, 24 Oct 2015 19:44:05 +0200, Michael Jones
Can you give me the revision in GIT that is the official 3.0.2 release so I can branch from it and apply my patch. It just convenient to use git to keep track of my tweaks and have access to the log, etc. If there are some compatible commits since then up to some point where it breaks, I would like to know where things break.
Mike
The 3.0.2 version has tag WX_3_0_2 in the GitHub repository Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
participants (2)
-
Henk-Jan van Tuyl
-
Michael Jones