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
602 stars 110 forks source link

[Bug]: MSVC2015 build failed with BIT7Z_AUTO_FORMAT #173

Closed wang-zuxian closed 8 months ago

wang-zuxian commented 8 months ago

bit7z version

4.0.x

Compilation options

BIT7Z_AUTO_FORMAT

7-zip version

v23.01

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

MSVC2015

Architecture

x86

Operating system

Windows

Operating system versions

Windows10

Bug description

Build a dll link bit7z.lib with BIT7Z_AUTO_FORMAT then show link error

16:21:57:379 2>bit7z.lib(bitinputarchive.obj) : error LNK2001: 无法解析的外部符号 "class bit7z::BitInFormat const & cdecl bit7z::detect_format_from_extension(class ghc::filesystem::path const &)" (?detect_format_from_extension@bit7z@@YAABVBitInFormat@1@ABVpath@filesystem@ghc@@@Z) 16:21:57:379 2>bit7z.lib(bitinputarchive.obj) : error LNK2001: 无法解析的外部符号 "class bit7z::BitInFormat const & cdecl bit7z::detect_format_from_signature(struct IInStream *)" (?detect_format_from_signature@bit7z@@YAABVBitInFormat@1@PAUIInStream@@@Z) fatal error LNK1120: 2 个无法解析的外部命令

Steps to reproduce

No response

Expected behavior

internal/formatdetect.cpp:

ifdef BIT7Z_AUTO_FORMAT

include

include "internal/formatdetect.hpp"

change to

include "internal/formatdetect.hpp"

ifdef BIT7Z_AUTO_FORMAT

include

then build success. THANKS.

Relevant compilation output

No response

Code of Conduct

rikyoz commented 8 months ago

Hi! Thank you for reporting the issue! Yesterday, I pushed a fix to the develop branch. I'll release a new version of bit7z with the fix soon.

rikyoz commented 8 months ago

Fixed in v4.0.4.