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]: _MSVC_VER typo? #113

Closed HoratiuMarginean closed 1 year ago

HoratiuMarginean commented 1 year ago

bit7z version

4.0.x beta

7-zip version

v19.00

7-zip DLL used

7z.dll

MSVC version

2022

Architecture

x86_64

Which version of Windows are you using?

Windows 10

Bug description

So I am trying to build an application I made a while ago that uses the v4.0.0-beta tag of this library and the latest stable release of the WxWidgets library. Both statically linked, Release, x64.

When I was first starting out(as well as just recently) I was getting this linker error and after I traced it down and I found these lines of code that are relevant:

guids.hpp

#ifndef _MSVC_VER
extern const GUID IID_IUnknown;
#endif

guids.cpp

#ifndef _MSVC_VER
const GUID IID_IUnknown = {
    0x00000000, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }
};
#endif

I could not for the life of me find the _MSVC_VER define anywhere else. I did however find _MSC_VER, which evaluates to the appropriate version of the compiler.

I assume that was the intended effect here, unless I am missing something.

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

1>uuid.lib(unknwn_i.obj) : error LNK2005: IID_IUnknown already defined in bit7z64.lib(guids.cpp.obj)

Code of Conduct

rikyoz commented 1 year ago

Hi! This is definitely a typo, sorry! I've just fixed it (27c537a). Strangely, it never gave me any issues! Thank you for pointing it out!