kanryu / quickviewer

A image/comic viewer application for Windows, Mac and Linux, it can show images very fast
https://kanryu.github.io/quickviewer/
GNU General Public License v3.0
543 stars 65 forks source link

Failed to build with MinGW64 / MSYS2 #170

Closed eddiezato closed 3 years ago

eddiezato commented 3 years ago

Log:

$ git clone https://github.com/kanryu/quickviewer.git --recursive
$ export CC=clang CXX=clang++
$ cd quickviewer
$ mkdir _build
$ cd _build
$ qmake -o Makefile -recursive ../QVProject.pro

Info: creating stash file D:\msys64\home\User\quickviewer\_build\.qmake.stash
Reading D:/msys64/home/User/quickviewer/Qt7z/Qt7z/Qt7z.pro [D:/msys64/home/User/quickviewer/_build/Qt7z/Qt7z]
Reading D:/msys64/home/User/quickviewer/ResizeHalf/ResizeHalf.pro [D:/msys64/home/User/quickviewer/_build/ResizeHalf]
Reading D:/msys64/home/User/quickviewer/easyexif/easyexif.pro [D:/msys64/home/User/quickviewer/_build/easyexif]
Reading D:/msys64/home/User/quickviewer/unrar/unrar.pro [D:/msys64/home/User/quickviewer/_build/unrar]
Reading D:/msys64/home/User/quickviewer/fileloader/fileloader.pro [D:/msys64/home/User/quickviewer/_build/fileloader]
Reading D:/msys64/home/User/quickviewer/zimg/zimg.pro [D:/msys64/home/User/quickviewer/_build/zimg]
Reading D:/msys64/home/User/quickviewer/QuickViewer/QuickViewer.pro [D:/msys64/home/User/quickviewer/_build/QuickViewer]
Project MESSAGE: QuickViewer without OpenGL Support
Project MESSAGE: QuickViewer without OpenGL Support
WARNING: Failure to find: release/QuickViewer_resource_res.o
Project MESSAGE: QuickViewer without OpenGL Support
WARNING: Failure to find: debug/QuickViewer_resource_res.o
Reading D:/msys64/home/User/quickviewer/qvtest/qvtest.pro [D:/msys64/home/User/quickviewer/_build/qvtest]
Reading D:/msys64/home/User/quickviewer/luminor/luminor.pro [D:/msys64/home/User/quickviewer/_build/luminor]
Reading D:/msys64/home/User/quickviewer/AssociateFilesWithQuickViewer/AssociateFilesWithQuickViewer.pro [D:/msys64/home/User/quickviewer/_build/AssociateFilesWithQuickViewer]
WARNING: Failure to find: release/AssociateFilesWithQuickViewer_resource_res.o
WARNING: Failure to find: debug/AssociateFilesWithQuickViewer_resource_res.o

$ make

cd Qt7z/Qt7z/ && ( test -e Makefile || D:/msys64/mingw64/bin/qmake.exe -o Makefile D:/msys64/home/User/quickviewer/Qt7z/Qt7z/Qt7z.pro ) && make -f Makefile
make[1]: Entering directory '/home/User/quickviewer/_build/Qt7z/Qt7z'
make -f Makefile.Release
make[2]: Entering directory '/home/User/quickviewer/_build/Qt7z/Qt7z'
g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -I../../../Qt7z/Qt7z -I. -I../../../Qt7z/Qt7z/7zip -I../../../Qt7z/Qt7z/7zip/CPP -I../../../Qt7z/Qt7z/lib7zip/src -ID:/msys64/mingw64/include/QtCore -Irelease -ID:/msys64/mingw64/share/qt5/mkspecs/win32-g++  -o release/7ZipArchive.o ../../../Qt7z/Qt7z/lib7zip/src/7ZipArchive.cpp
In file included from ../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyString.h:15,
                 from ../../../Qt7z/Qt7z/7zip/CPP/Windows/PropVariant.h:8,
                 from ../../../Qt7z/Qt7z/lib7zip/src/7ZipArchive.cpp:12:
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h: In member function 'void CRecordVector<T>::ReserveOnePosition()':
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:26:24: error: expected primary-expression before ',' token
   26 |       MY_ARRAY_NEW(p, T, newCapacity);
      |                        ^
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h: In member function 'void CRecordVector<T>::ConstructReserve(unsigned int)':
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:59:29: error: expected primary-expression before ',' token
   59 |       MY_ARRAY_NEW(_items, T, size)
      |                             ^
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:59:36: error: expected ';' before '_capacity'
   59 |       MY_ARRAY_NEW(_items, T, size)
      |                                    ^
      |                                    ;
   60 |       // _items = new T[size];
   61 |       _capacity = size;
      |       ~~~~~~~~~
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h: In member function 'void CRecordVector<T>::Reserve(unsigned int)':
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:70:24: error: expected primary-expression before ',' token
   70 |       MY_ARRAY_NEW(p, T, newCapacity);
      |                        ^
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h: In member function 'void CRecordVector<T>::ClearAndReserve(unsigned int)':
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:88:29: error: expected primary-expression before ',' token
   88 |       MY_ARRAY_NEW(_items, T, newCapacity)
      |                             ^
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:88:43: error: expected ';' before '_capacity'
   88 |       MY_ARRAY_NEW(_items, T, newCapacity)
      |                                           ^
      |                                           ;
   89 |       // _items = new T[newCapacity];
   90 |       _capacity = newCapacity;
      |       ~~~~~~~~~
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h: In member function 'void CRecordVector<T>::ChangeSize_KeepData(unsigned int)':
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:105:24: error: expected primary-expression before ',' token
  105 |       MY_ARRAY_NEW(p, T, newSize)
      |                        ^
../../../Qt7z/Qt7z/7zip/CPP/Windows/../Common/MyVector.h:105:34: error: expected ';' before 'if'
  105 |       MY_ARRAY_NEW(p, T, newSize)
      |                                  ^
      |                                  ;
  106 |       // p = new T[newSize];
  107 |       if (_size != 0)
      |       ~~
In file included from ../../../Qt7z/Qt7z/7zip/CPP/7zip/Common/../../Windows/FileIO.h:13,
                 from ../../../Qt7z/Qt7z/7zip/CPP/7zip/Common/FileStreams.h:13,
                 from ../../../Qt7z/Qt7z/lib7zip/src/7ZipArchive.cpp:16:
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h: In constructor 'CObjArray<T>::CObjArray(size_t)':
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:148:29: error: expected primary-expression before ',' token
  148 |       MY_ARRAY_NEW(_items, T, size)
      |                             ^
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:148:36: error: expected ';' before '}' token
  148 |       MY_ARRAY_NEW(_items, T, size)
      |                                    ^
      |                                    ;
  149 |       // _items = new T[size];
  150 |     }
      |     ~
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h: In member function 'void CObjArray<T>::Alloc(size_t)':
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:162:27: error: expected primary-expression before ',' token
  162 |     MY_ARRAY_NEW(_items, T, newSize)
      |                           ^
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:162:37: error: expected ';' before '}' token
  162 |     MY_ARRAY_NEW(_items, T, newSize)
      |                                     ^
      |                                     ;
  163 |     // _items = new T[newSize];
  164 |   }
      |   ~
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h: In member function 'void CObjArray2<T>::SetSize(unsigned int)':
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:232:32: error: expected primary-expression before ',' token
  232 |       MY_ARRAY_NEW(newBuffer, T, size)
      |                                ^
D:/msys64/home/User/quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h:232:39: error: expected ';' before '}' token
  232 |       MY_ARRAY_NEW(newBuffer, T, size)
      |                                       ^
      |                                       ;
  233 |       // newBuffer = new T[size];
  234 |     }
      |     ~
make[2]: *** [Makefile.Release:197: release/7ZipArchive.o] Error 1
make[2]: Leaving directory '/home/User/quickviewer/_build/Qt7z/Qt7z'
make[1]: *** [Makefile:45: release] Error 2
make[1]: Leaving directory '/home/User/quickviewer/_build/Qt7z/Qt7z'
make: *** [Makefile:59: sub-Qt7z-Qt7z-make_first] Error 2
eddiezato commented 3 years ago

This is disaster. I managed to fix errors for Qt7z. Need just add #include "Common.h" to quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyBuffer.h quickviewer/Qt7z/Qt7z/7zip/CPP/Common/MyVector.h But there is always something else. Like missing #include <stddef.h> in quickviewer/zimg/src/zimg/colorspace/matrix3.cpp And in the end you can't build it anyway.

eddiezato commented 3 years ago

Ok, I apologize for the emotionality in the previous post. I was able to build with mingw.