Quazip and Qt6 mingw
-
Is it possible to compile the quazip library for Qt 6.5.2 using the mingw compiler? Initially, I found information that it was not, but I would like to make sure 😀 if it is true, do you have any other ways to pack files into a ZIP archive?
-
@apaczenko1993 said in Quazip and Qt6 mingw:
s it possible to compile the quazip library for Qt 6.5.2 using the mingw compiler?
Why should it not be possible? Just try it out.
-
This is the first time I will try to create a dll file myself, so I will let you know if I have any problems
-
So i dowload the zlib_source and a beginning i ahve a problem with build zlib.
I try use instruction from: Build instructionI have install cmake from qt maintanance tool.
After pass commands from instruction i have this error, I know that is a problem with compiler, how can i set it?(c) Microsoft Corporation. Wszelkie prawa zastrzeżone. C:\Users\szlapiem>cd C:\zlib-1.3.1 C:\zlib-1.3.1>mkdir build C:\zlib-1.3.1>cd build C:\zlib-1.3.1\build>cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=c:\zlib-1.3.1\build\final -- Building for: NMake Makefiles CMake Error at CMakeLists.txt:4 (project): Running 'nmake' '-?' failed with: Nie można odnaleźć określonego pliku CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! C:\zlib-1.3.1\build>
-
@apaczenko1993
Does https://stackoverflow.com/questions/70524164/cmake-c-compiler-not-set-after-enablelanguage help?cmake -DCMAKE_CXX_COMPILER=/pathto/g++ -DCMAKE_C_COMPILER=/pathto/gcc /pathto/source
Is your MinGW compiler on your
PATH
? -
@apaczenko1993
-DCMAKE_C_COMPILER=/pathto/gcc
is not an environment variable (though you might be able to do that, I don't know)m it's a define tocmake
(and I don't know whether it puts that into environment or just uses it directly).But I think the references said you could put
mingw_64\bin
on yourPATH
. "Is it ok?" --- I don't know, does it make things work for you?! -
@apaczenko1993 You should simply build in the terminal provided by your Qt installation - you will find it in Windows Start menu. In that case everything is preconfigured to build with MinGW.
-
Ok , so i tried again with setting compiler and now i get this
Setting up environment for Qt usage... C:\Qt\6.5.3\mingw_64>cd c:\zlib-1.3.1\build c:\zlib-1.3.1\build>cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=C:\zlib-1.3.1\build\final -DCMAKE_CXX_COMPILER=C:\Qt/Tools\mingw1120_64\g++.exe -DCMAKE_C_COMPILER=C:\Qt\Tools\mingw1120_64\gcc.exe CMake Error at CMakeLists.txt:4 (project): Running 'nmake' '-?' failed with: Nie można odnaleźć określonego pliku -- Configuring incomplete, errors occurred! c:\zlib-1.3.1\build>
I have in zlib folder file named configure but i dont know how use it
-
@apaczenko1993
I do not have MinGW. You have setC:\Qt/Tools\mingw1120_64\g++.exe
. Are you sure that is the right directory? It does not have abin\
sub-sirectory? -
Of course has, my mistake. But still same result :/
c:\zlib-1.3.1\build>cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=C:\zlib-1.3.1\build\final -DCMAKE_CXX_COMPILER=C:\Qt\Tools\mingw1120_64\bin\g++.exe -DCMAKE_C_COMPILER=C:\Qt\Tools\mingw1120_64\bin\gcc.exe CMake Error at CMakeLists.txt:4 (project): Running 'nmake' '-?' failed with: Nie można odnaleźć określonego pliku -- Configuring incomplete, errors occurred! c:\zlib-1.3.1\build>
-
Christian Ehrlicher Lifetime Qt Championreplied to apaczenko1993 on last edited by Christian Ehrlicher
@apaczenko1993 Please do what @jsulm told you to set up the compiler environment correctly. Also start over with a clean build dir and pass
-G "MinGW Makefiles"
to the cmake call and don't pass MAKE_CXX_COMPILER and CMAKE_C_COMPILER -
@Christian-Ehrlicher Thank you! So first step complet, next quazip
-
@apaczenko1993 Now during compiling quazip i have this error
C:\quazip-master\build>cmake -G "MinGW Makefiles" c:\quazip-master -DZLIB_LIBRARY="C:\zlib-1.3.1\build\release" -DZLIB_INCLUDE_DIR="C:\zlib-1.3.1\" -- The C compiler identification is GNU 11.2.0 -- The CXX compiler identification is GNU 11.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Qt/Tools/mingw1120_64/bin/gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Qt/Tools/mingw1120_64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Found WrapAtomic: TRUE -- Found Qt 6.5.2: C:/Qt/6.5.2/mingw_64 -- Using Qt version 6 -- Found ZLIB: C:\zlib-1.3.1\build\release (found version "1.3.1") -- Fetching bzip2 https://sourceware.org/git/bzip2.git master -- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) -- Configuring done (10.2s) -- Generating done (0.1s) -- Build files have been written to: C:/quazip-master/build C:\quazip-master\build>cmake --build . --target install [ 3%] Automatic MOC for target bzip2 [ 3%] Built target bzip2_autogen [ 7%] Building CXX object CMakeFiles/bzip2.dir/bzip2_autogen/mocs_compilation.cpp.obj [ 11%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/blocksort.c.obj [ 14%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/bzlib.c.obj [ 18%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/compress.c.obj [ 22%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/crctable.c.obj [ 25%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/decompress.c.obj [ 29%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/huffman.c.obj [ 33%] Building C object CMakeFiles/bzip2.dir/lib/bzip2/randtable.c.obj [ 37%] Linking CXX static library libbzip2.a [ 37%] Built target bzip2 [ 40%] Automatic MOC for target QuaZip [ 40%] Built target QuaZip_autogen [ 44%] Building CXX object quazip/CMakeFiles/QuaZip.dir/QuaZip_autogen/mocs_compilation.cpp.obj [ 48%] Building C object quazip/CMakeFiles/QuaZip.dir/unzip.c.obj [ 51%] Building C object quazip/CMakeFiles/QuaZip.dir/zip.c.obj [ 55%] Building CXX object quazip/CMakeFiles/QuaZip.dir/JlCompress.cpp.obj [ 59%] Building CXX object quazip/CMakeFiles/QuaZip.dir/qioapi.cpp.obj [ 62%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quaadler32.cpp.obj [ 66%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quachecksum32.cpp.obj [ 70%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quacrc32.cpp.obj [ 74%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quagzipfile.cpp.obj [ 77%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quaziodevice.cpp.obj [ 81%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quazip.cpp.obj [ 85%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quazipdir.cpp.obj [ 88%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quazipfile.cpp.obj [ 92%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quazipfileinfo.cpp.obj [ 96%] Building CXX object quazip/CMakeFiles/QuaZip.dir/quazipnewinfo.cpp.obj [100%] Linking CXX shared library libquazip1-qt6.dll C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:zlib-1.3.1buildrelease: No such file or directory collect2.exe: error: ld returned 1 exit status mingw32-make.exe[2]: *** [quazip\CMakeFiles\QuaZip.dir\build.make:341: quazip/libquazip1-qt6.dll] Error 1 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:154: quazip/CMakeFiles/QuaZip.dir/all] Error 2 mingw32-make.exe: *** [Makefile:135: all] Error 2 C:\quazip-master\build>
-
You have msys in your PATH - remove it and start over with a clean build dir.
-
-
Christian Ehrlicher Lifetime Qt Championreplied to apaczenko1993 on last edited by Christian Ehrlicher
Somewhere in your PATH env var you have a
bash.exe
,sh.exe
or similar so the directory separators are messed up (/
<->\
) and the compilation is failing. -
Ok finally builded, thanks for help :)
-