Error when building #16467

Closed
opened 2026-01-31 05:13:09 +00:00 by claunia · 12 comments
Owner

Originally created by @RyanGibb on GitHub (Jan 22, 2022).

Windows Terminal version

v1.11.2921.0

Windows build number

10.0.19042.0

Other Software

No response

Steps to reproduce

In powershell:

git@github.com:microsoft/terminal.git
cd terminal
git submodule update --init --recursive
Import-Module .\tools\OpenConsole.psm1
Set-MsBuildDevEnvironment
Invoke-OpenConsoleBuild

Expected Behavior

No errors, I imagine.

Actual Behavior

With wt v1.11.2921.0 I'm getting the error:

"C:\Users\ryang\terminal\OpenConsole.sln" (default target) (1) ->
"C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj.metaproj" (default target) (80) ->
"C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj" (default target) (81) ->
(Link target) ->
  Microsoft.Terminal.Settings.Model.Lib.lib(init.obj) : error LNK2005: DllMain already defined in TerminalAppLib.lib(init.obj) [C:\U
sers\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj]
  C:\Users\ryang\terminal\bin\x64\Debug\UnitTests_TerminalApp\Terminal.App.Unit.Tests.dll : fatal error LNK1169: one or more multipl
y defined symbols found [C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj]

    38 Warning(s)
    2 Error(s)

Time Elapsed 00:10:08.22

With wt v1.11.3471.0, I'm getting the error:


       "C:\Users\ryang\terminal\OpenConsole.sln" (Clean;Build target) (1) ->
       "C:\Users\ryang\terminal\src\server\lib\server.vcxproj.metaproj" (Clean;Build target) (13) ->
       "C:\Users\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj" (default target) (17:9) ->
       (Link target) ->
         dlldata.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\host\proxy\
       Host.Proxy.vcxproj]
         IConsoleHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\h
       ost\proxy\Host.Proxy.vcxproj]
         ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\
       host\proxy\Host.Proxy.vcxproj]
         dlldata.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\host\proxy\
       Host.Proxy.vcxproj]
         IConsoleHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\h
       ost\proxy\Host.Proxy.vcxproj]
         ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\
       host\proxy\Host.Proxy.vcxproj]
         IConsoleHandoff_p.obj : error LNK2019: unresolved external symbol memcmp referenced in function _IConsoleHando
       ff_IID_Lookup [C:\Users\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj]
         ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol memcmp [C:\Users\ryang\terminal\src\host\pr
       oxy\Host.Proxy.vcxproj]
         C:\Users\ryang\terminal\bin\x64\Debug\OpenConsoleProxy.dll : fatal error LNK1120: 3 unresolved externals [C:\U
       sers\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj]

    10 Warning(s)
    9 Error(s)

Time Elapsed 00:00:55.24
Originally created by @RyanGibb on GitHub (Jan 22, 2022). ### Windows Terminal version v1.11.2921.0 ### Windows build number 10.0.19042.0 ### Other Software _No response_ ### Steps to reproduce In powershell: ``` git@github.com:microsoft/terminal.git cd terminal git submodule update --init --recursive Import-Module .\tools\OpenConsole.psm1 Set-MsBuildDevEnvironment Invoke-OpenConsoleBuild ``` ### Expected Behavior No errors, I imagine. ### Actual Behavior With wt v1.11.2921.0 I'm getting the error: ``` "C:\Users\ryang\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj.metaproj" (default target) (80) -> "C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj" (default target) (81) -> (Link target) -> Microsoft.Terminal.Settings.Model.Lib.lib(init.obj) : error LNK2005: DllMain already defined in TerminalAppLib.lib(init.obj) [C:\U sers\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj] C:\Users\ryang\terminal\bin\x64\Debug\UnitTests_TerminalApp\Terminal.App.Unit.Tests.dll : fatal error LNK1169: one or more multipl y defined symbols found [C:\Users\ryang\terminal\src\cascadia\ut_app\TerminalApp.UnitTests.vcxproj] 38 Warning(s) 2 Error(s) Time Elapsed 00:10:08.22 ``` With wt v1.11.3471.0, I'm getting the error: ``` "C:\Users\ryang\terminal\OpenConsole.sln" (Clean;Build target) (1) -> "C:\Users\ryang\terminal\src\server\lib\server.vcxproj.metaproj" (Clean;Build target) (13) -> "C:\Users\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj" (default target) (17:9) -> (Link target) -> dlldata.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\host\proxy\ Host.Proxy.vcxproj] IConsoleHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\h ost\proxy\Host.Proxy.vcxproj] ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\Users\ryang\terminal\src\ host\proxy\Host.Proxy.vcxproj] dlldata.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\host\proxy\ Host.Proxy.vcxproj] IConsoleHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\h ost\proxy\Host.Proxy.vcxproj] ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\Users\ryang\terminal\src\ host\proxy\Host.Proxy.vcxproj] IConsoleHandoff_p.obj : error LNK2019: unresolved external symbol memcmp referenced in function _IConsoleHando ff_IID_Lookup [C:\Users\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj] ITerminalHandoff_p.obj : error LNK2001: unresolved external symbol memcmp [C:\Users\ryang\terminal\src\host\pr oxy\Host.Proxy.vcxproj] C:\Users\ryang\terminal\bin\x64\Debug\OpenConsoleProxy.dll : fatal error LNK1120: 3 unresolved externals [C:\U sers\ryang\terminal\src\host\proxy\Host.Proxy.vcxproj] 10 Warning(s) 9 Error(s) Time Elapsed 00:00:55.24 ```
Author
Owner

@zadjii-msft commented on GitHub (Jan 24, 2022):

Huh well that is weird. The first I'd totally expect to see - I see that one all the time, but usually it's just a warning. Maybe you've git some other settings misconfigured? It's also possible that OpenConsole.psm1 hasn't been totally kept up to date. I know I primarily rely on the CMD build tools in tools/razzle.cmd.

The second I might take a look at this link. I feel like I saw this once when we were first adding those bits to the solution, but not since, I can't remember if it's something I changed or not.

Which version of VS are you using?

@zadjii-msft commented on GitHub (Jan 24, 2022): Huh well that is weird. The first I'd totally expect to see - I see that one all the time, but usually it's just a warning. Maybe you've git some other settings misconfigured? It's also possible that `OpenConsole.psm1` hasn't been totally kept up to date. I know I primarily rely on the CMD build tools in `tools/razzle.cmd`. The second I might take a look at [this link](https://stackoverflow.com/questions/10158013/unresolved-external-symbols-rtc-in-windows-programming-tutorial/33012350). I feel like I saw this once when we were first adding those bits to the solution, but not since, I can't remember if it's something I changed or not. Which version of VS are you using?
Author
Owner

@RyanGibb commented on GitHub (Jan 24, 2022):

Thanks for getting back to me.

Trying the CMD build tools (below) results in exactly the same errors:/

tools/razzle.cmd
bcz

I've got Visual Studio Community 2019 16.11.9 installed.

I have been developing for the Hololense 2 with Unity through VS. I'm not sure if something configured during that could be messing things up?

Windows terminal v1.10.2714.0 builds with a lot of warnings, but no errors, so I'll try using it in the meantime.

@RyanGibb commented on GitHub (Jan 24, 2022): Thanks for getting back to me. Trying the CMD build tools (below) results in exactly the same errors:/ ``` tools/razzle.cmd bcz ``` I've got Visual Studio Community 2019 16.11.9 installed. I have been developing for the Hololense 2 with Unity through VS. I'm not sure if something configured during that could be messing things up? Windows terminal v1.10.2714.0 builds with a lot of warnings, but no errors, so I'll try using it in the meantime.
Author
Owner

@RyanGibb commented on GitHub (Jan 24, 2022):

Actually, I lied, v1.10.2714.0 fails to publish:
image

@RyanGibb commented on GitHub (Jan 24, 2022): Actually, I lied, v1.10.2714.0 fails to publish: ![image](https://user-images.githubusercontent.com/22669046/150817517-f872fe24-1880-43bf-8153-c35952260a24.png)
Author
Owner

@RyanGibb commented on GitHub (Jan 24, 2022):

Okay, going back to v1.11.3471.0, the most recent version, the suggestion in the link of disabling runtime checks removes most of the LNK2001's. I'm worried this is just pushing the problem to runtime though, as I'm not really sure what's going wrong with the linking.

Also these errors still persist:
image

@RyanGibb commented on GitHub (Jan 24, 2022): Okay, going back to v1.11.3471.0, the most recent version, the suggestion in the [link](https://stackoverflow.com/questions/10158013/unresolved-external-symbols-rtc-in-windows-programming-tutorial/33012350) of disabling runtime checks removes most of the LNK2001's. I'm worried this is just pushing the problem to runtime though, as I'm not really sure what's going wrong with the linking. Also these errors still persist: ![image](https://user-images.githubusercontent.com/22669046/150831081-e89ee60a-f9eb-4850-b511-f1a47128bb6f.png)
Author
Owner

@elsaco commented on GitHub (Jan 25, 2022):

@RyanGibb there are 4 projects in the solution (not needed for Cascadia) that target .NET Framework 4.5:

Windows.Terminal.UIA.Tests
VTApp
Host.Tests.UIA
WindowsTerminal.UIA.Tests

In VS you'll see warnings when loading the solution, like:

The C# project Windows.Terminal.UIA.Tests targets .NET Framework 45, which is no longer supported.

I did a successful build of 5258feaf from command line but had to change the framework to 4.8:

Invoke-OpenConsoleBuild /p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8"

In VS is easy to just build CascadiaPackage instead of the whole solution. On command line it didn't work for me.

@elsaco commented on GitHub (Jan 25, 2022): @RyanGibb there are 4 projects in the solution (not needed for Cascadia) that target .NET Framework 4.5: ``` Windows.Terminal.UIA.Tests VTApp Host.Tests.UIA WindowsTerminal.UIA.Tests ``` In VS you'll see warnings when loading the solution, like: `The C# project Windows.Terminal.UIA.Tests targets .NET Framework 45, which is no longer supported.` I did a successful build of `5258feaf` from command line but had to change the framework to 4.8: `Invoke-OpenConsoleBuild /p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8"` In VS is easy to just build `CascadiaPackage` instead of the whole solution. On command line it didn't work for me.
Author
Owner

@RyanGibb commented on GitHub (Jan 25, 2022):

Thanks for responding elsaco.

I don't see those warnings actually.

And it seems OpenConsoleProxy is required by CascadiaPackage. Although I have to admit I don't undestand how this build system works.

What version of VS are you using?

I'm still getting various linking errors with different versions of the terminal. I'm just building CascadiaPackage inside VS.

@RyanGibb commented on GitHub (Jan 25, 2022): Thanks for responding elsaco. I don't see those warnings actually. And it seems OpenConsoleProxy is required by `CascadiaPackage`. Although I have to admit I don't undestand how this build system works. What version of VS are you using? I'm still getting various linking errors with different versions of the terminal. I'm just building `CascadiaPackage` inside VS.
Author
Owner

@elsaco commented on GitHub (Jan 25, 2022):

@RyanGibb I'm using Win10 and VS2022 (the poor man's edition). When the solution is loaded into VS this kind of warnings pop-up:

wt_warrning_01

@elsaco commented on GitHub (Jan 25, 2022): @RyanGibb I'm using Win10 and VS2022 (the poor man's edition). When the solution is loaded into VS this kind of warnings pop-up: ![wt_warrning_01](https://user-images.githubusercontent.com/3933920/151013022-c7196349-3b0f-4feb-9d57-7a98c52b6467.png)
Author
Owner

@RyanGibb commented on GitHub (Jan 25, 2022):

Strange... I tried VS 2019 and 2022, didn't get these warnings in either.

@RyanGibb commented on GitHub (Jan 25, 2022): Strange... I tried VS 2019 and 2022, didn't get these warnings in either.
Author
Owner

@zadjii-msft commented on GitHub (Jan 25, 2022):

I have seen this before! It should have been fixed by #11632

@zadjii-msft commented on GitHub (Jan 25, 2022): I _have_ seen this before! It should have been fixed by #11632
Author
Owner

@zadjii-msft commented on GitHub (Jan 31, 2022):

@RyanGibb were you building main or another commit? Because I'm pretty sure #11632 should have fixed the build issues with _RTC_InitBase et. al...

@zadjii-msft commented on GitHub (Jan 31, 2022): @RyanGibb were you building `main` or another commit? Because I'm pretty sure #11632 should have fixed the build issues with `_RTC_InitBase` et. al...
Author
Owner

@RyanGibb commented on GitHub (Jan 31, 2022):

I was building with the commits associated with the version tags mentioned, so v1.11.3471.0 should have included #11632 afaik

@RyanGibb commented on GitHub (Jan 31, 2022): I was building with the commits associated with the version tags mentioned, so v1.11.3471.0 should have included #11632 afaik
Author
Owner

@RyanGibb commented on GitHub (Feb 10, 2022):

So I managed to use the MSIX Packaging Tool to change the target platform to Windows.Universal, which is what I was trying to achieve by building the terminal locally.

It seems Win32 applications are not longer supported on the Hololens (#693), as implied by #6101 and #9267, but I thought I'd try for myself.

@RyanGibb commented on GitHub (Feb 10, 2022): So I managed to use the [MSIX Packaging Tool](https://www.microsoft.com/en-gb/p/msix-packaging-tool/9n5lw3jbcxkf?rtc=1&activetab=pivot:overviewtab) to change the target platform to `Windows.Universal`, which is what I was trying to achieve by building the terminal locally. It seems Win32 applications are not longer supported on the Hololens (#693), as implied by #6101 and #9267, but I thought I'd try for myself.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16467