rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
634 stars 116 forks source link

[Bug]: VS2019 compile error #153

Open ShiverZm opened 1 year ago

ShiverZm commented 1 year ago

bit7z version

3.2.x

Compilation options

BIT7Z_AUTO_FORMAT

7-zip version

v22.01

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

vs2019

Architecture

x86_64

Operating system

Windows

Operating system versions

win10

Bug description

1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : warning C4183: "MY_UNKNOWN_IMP3" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source file D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C3646: "HRESULT" : Unknown override specifier (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C2143: syntax errors: lack of ";" (in front of "__cdecl") (Compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : warning C4183: "MY_UNKNOWN_IMP3" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49,87) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49,87) : warning C4183: "SetTotal" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp) 1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C2555: "bit7z: : opencallback: : SetTotal" : The overridden virtual function has a different return type and is not from IArchiveOpen

Steps to reproduce

build by below steps:

cd <bit7z folder>
mkdir build && cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
cmake --build . -j --config Release

Expected behavior

success

Relevant compilation output

1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cmultivolumeinstream HPP (47, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cmultivolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cstdoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/extractcallback HPP (63, 9) : warning C4183: "MY_UNKNOWN_IMP3" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\extractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source file D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\fileextractcallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdoutstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cvolumeoutstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\fsitem.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C2144: syntax errors: the front of the "HRESULT" should be ";" (Compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/cstdinstream HPP (43, 9) : warning C4183: "MY_UNKNOWN_IMP1" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\cvolumeinstream.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C3646: "HRESULT" : Unknown override specifier (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C2143: syntax errors: lack of ";" (in front of "__cdecl") (Compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : warning C4183: "MY_UNKNOWN_IMP3" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49,87) : error C4430: lack of type specifier - is assumed to be an int. Note: C++ does not support default int (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49,87) : warning C4183: "SetTotal" : the lack of a return type; Assumed to be a member function that returns "int" (compile source D:\workspace\github\bit7z\src\internal\opencallback.cpp)
1 > D: \ workspace \ lot \ bit7z \ SRC \ internal/opencallback HPP (49, 9) : error C2555: "bit7z: : opencallback: : SetTotal" : The overridden virtual function has a different return type and is not from IArchiveOpen

Code of Conduct

rikyoz commented 1 year ago

Hi! Unfortunately, I wasn't able to reproduce your issue! Do you have the Windows 10 SDK installed on your system? It is usually installed with Visual Studio/MSVC, but if for some reason it is not, you might end up with similar error messages!

anywhereyang commented 1 year ago

@rikyoz @ShiverZm i reproduce your issue! when i try to complie the v4.0,,because i use command " git clone https://github.com/rikyoz/bit7z" to get the code ,but not clone the submodule , and i download the 7zip sdk ,

just use git clone https://github.com/rikyoz/bit7z --recurse ,and no this probelm