Open tmh2211 opened 7 years ago
Hi @tmh2211 , great to hear you want to use haskell-opencv
for your bachelor project and that you are trying to get it to build on Windows. We haven't tried building it on Windows yet so it would be great to get support for that!
Unfortunately I can't help you with your problem since I don't have a Windows machine. Maybe try googling for similar problems.
I don't have either Window. But I could recommend:
1- To use stack. There you'll have the stack.yaml and the your-project.cabal It works fine for me. 2- See here: https://github.com/LumiGuide/haskell-opencv/issues/1 Maybe you can get some idea there.
Thanks for your replies. Had the same issue with stack. Maybe I'll just switch to linux.
It would be a safe and healthy choice :joy:
I successfully build 0.0.2.1 from source on MinGW with stack's buildin MinGW environment
during the building process, I encounted 'undefined symbol __ZdlPvm' while building OpenCV/Core/Types/Rect. It was caused by Template Haskell that can not link stdc++-6.dll. So in opencv.cabal at ghc-options tag, add -lstdc++ to solve the problem
then I use stack to create a new project, on stack.yaml I set lts-13.25. setup environment variable PKG_CONFIG_PATH pointing to opencv.pc, execute stack build
copy paste an highgui example program from opencv source directory to main.hs, stack build agian
copy libstdc++-6.dll from msys provided by stack to the current directory, so that you can execute stack exec Your-program
additional comment, I recommended to build opencv from source on MinGW. I download opencv-3.4.2 from github, use stack to create an new project, specific lts-13.25 or any other lts equal or greater than lts-10.2 is ok.
then I should use stack's buildin gcc to compile opencv source
I invoke stack exec -- pacman -S mingw-w64-x86_64-make to install make utility, and so is cmake, stack exec -- pacman -S mingw-w64-x86_64-cmake
I invoke stack exec -- sh, this put you in stack's current(lts-13.25) shell environment
cd to opencv preconfigured build directory
cmake-gui -DCMAKE_MAKE_PROGRAM=path to configurate the opencv build parameters, generate the makefile
mingw32-make -j4; mingw32-make install
I also successfully build under lts-18.28 on win10, I can not help to share some tips, I use stack doing the whole jobs
Hi Guys, I want to use your library for my bachelor project and therefor I'm trying to install it on windows.
I downloaded the opencv version 3.1 for Windows and extracted it to C:\opencv. Then I created the following pc-File:
Name: opencv
Description: Library for machine vision
Version: 3.1.0
CFlags: -IC:\\opencv\\build\\include
Libs: -LC\\opencv\\build\\x64\\vc12\\lib -lopencv_world310
Next I cloned your repository and tried to install it via:cabal install opencv.cabal
This works until the compilation of OpenCV.Internal.Core.Types.Mat. There I get the following error:
`[36 of 70] Compiling OpenCV.Internal.Core.Types.Mat ( src\OpenCV\Internal\Core\Types\Mat.hs, dist\dist-sandbox-800a0dac\build\OpenCV\Internal\Core\Types\Mat.o )
ghc.exe: dist/dist-sandbox-800a0dac\build\OpenCV\Internal\Exception.o: unknown symbol
inline_c_OpenCV_Internal_Exception_1_2402dbf3aea4f7f79392b71ed42618962a22e9aa' cabal: Error: some packages failed to install: opencv-0.0.0 failed during the building phase. The exception was: ExitFailure 1
My ghc version is: 7.10.3
Note: I'm not an expert on building such projects - especially C - so I'm pretty sure I did something wrong :D.
Thanks for your help