sw icon indicating copy to clipboard operation
sw copied to clipboard

Exception in cmake using tesseract cmake example

Open Ghost295 opened this issue 3 years ago • 4 comments

I'm probably missing something obvious but now that I got sw working. When I try to try the tesseract cmake example it gives this error:

Exception in file D:/dev/cppan2/client2/src/sw/driver/module.cpp:120, function operator (): error in module (C:/Users/USER/.sw/storage/tmp/cfg/181123/loc.sw.self.1800ba-0.0.28.dll): Exception in file D:/dev/cppan2/client2/src/sw/driver/target/native.cpp:699, function findCompiler: Cannot find compiler org.gnu.gcc->=8.1.0 <8.2.0 for settings: {"native":{"configuration":"debug","library":"shared","mt":"false","program":{"asm":"org.gnu.gcc->=8.1.0 <8.2.0","c":"org.gnu.gcc->=8.1.0 <8.2.0","cpp":"org.gnu.gpp->=8.1.0 <8.2.0","lib":"org.gnu.binutils.ar"}},"os":{"arch":"x86_64","kernel":"org.mingw"}} sw command: D:/sw-package-manager/sw.exe -shared -platform x64 -compiler gcc-8.1 -os mingw -d D:/TestProject/cmake-build-debug/.sw/cmake -config d integrate -cmake-deps D:/TestProject/cmake-build-debug/.sw/cmake/sw.txt -cmake-file-version 6

I am using Clion if that makes a difference. I know it says that it cannot find the compiler but I have mingw64 installed.

Ghost295 avatar Jun 12 '21 07:06 Ghost295

Do you have Visual Studio C++ compiler installed? C++ workflow in VS installer. Try to run cmake with VS generator.


If you run cmake with mingw, it may have issues actually. First, I'd update mingw/gcc version to gcc-11. This could be achieved with msys2 package.

egorpugin avatar Jun 12 '21 09:06 egorpugin

What do you mean by Visual Studio C++ compiler?

I installed msys2 for mingw/gcc but now its version 10 not 11. Still getting the same error.

Ghost295 avatar Jun 12 '21 23:06 Ghost295

I see. Can you send your CMakeLists.txt? Mingw workflows are not very well tested yet.

egorpugin avatar Jun 13 '21 09:06 egorpugin

Sure, no problem. CMakeLists.txt

Ghost295 avatar Jun 14 '21 06:06 Ghost295