Hello,

I Found It!!  I tend to move at warp speed.

*_VS2022_*_DLINK2_FLAGS    = /WHOLEARCHIVE

The /WHOLEARCHIVE is the culprit


On Tue, Jan 13, 2026 at 9:03 PM David F. <[email protected]> wrote:
>
> Hello,
>
> I set up a fresh new set of directories for edk2 / edk2-libc to build
> my UEFI application using the latest VS2022 instead of VS2008 (had
> tried VS2019 about six months to a year ago and had the same issue as
> I'm having with VS2022).
>
> Background:  There is a master library (millions of lines of code)
> that I build for UEFI that has a lot of support routines.  That
> library is used not only for UEFI, but DOS, Windows (x86,x64, ARM64),
> Linux (x86,x64), Windows Drivers (x86, x64, ARM64), Linux Drivers
> (x86, x64).   Where needed, the source is wrapped in #if defined() for
> the different environments.   Yes, C++ is used, but the new/delete are
> just calling malloc/free and don't use exceptions.
>
> The problem I have when linking this library using VS2022 (and VS2019)
> I get a bunch of "unresolved external symbol" errors for things that
> are not used in the UEFI application.  /OPT:REF is enabled on the
> build.   I rebuilt the master library using VS2022 before building the
> app.
>
> There are a lot more, but a small sample is shown below.  Now, if I
> simply rebuild the library using VS2008 then put back the old EDK2
> BuildTools/Conf directory that I was using for VS2008, I can build and
> everything builds and links correctly without this issue.
>
> I'm not sure which VS version started this, I stuck with VS2008 since
> it just worked.  Now I want to build using NX so need to upgrade
> VS2008 to a newer version (I guess I could try the first version that
> supported NX).  But, anyway, does anyone out there have any idea what
> may be going on here (is it the new build tools in edk2?) and a way
> around it?  It's annoying.
>
> acme.lib(LzmaDec.obj) : error LNK2001: unresolved external symbol
> LzmaDec_DecodeReal_3
> acme.lib(MSGBOX.obj) : error LNK2001: unresolved external symbol "char
> const * const tHKOK" (?tHKOK@@3QBDB)
> acme.lib(INPUTBOX.obj) : error LNK2001: unresolved external symbol
> "char const * const tHKOK" (?tHKOK@@3QBDB)
> acme.lib(FILEDLG.obj) : error LNK2001: unresolved external symbol
> "char const * const tHKOK" (?tHKOK@@3QBDB)
> acme.lib(MSGBOX.obj) : error LNK2001: unresolved external symbol "char
> const * const tHKCancel" (?tHKCancel@@3QBDB)
> acme.lib(INPUTBOX.obj) : error LNK2001: unresolved external symbol
> "char const * const tHKCancel" (?tHKCancel@@3QBDB)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121756): https://edk2.groups.io/g/devel/message/121756
Mute This Topic: https://groups.io/mt/117257031/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to