UWP build

Hi guys, Im trying to build a UWP from a D3D project, but I get these errors, can anyone work out whats wrong? I remember I already had this working so not sure whats happened.

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK1104    cannot open file 'D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\build\bin\x64\Debug\GameAssembly.lib'    Tenement    D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\Tenement\LINK    1   
Error        Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\link.exe /out:"D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\build\obj\il2cppOutputProject\x64\Debug\linkresult_36293C95F6921570993C1F6C23168A7D\GameAssembly.dll" /ignore:4206 /DEBUG:FASTLINK /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "Shcore.lib" "WindowsApp.lib" "Crypt32.lib" "Iphlpapi.lib" "F:\Program Files\Unity 2021.2.4f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\x64\Debug\baselib.dll.lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\lib\x64\store" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\ucrt\x64" /APPCONTAINER /SUBSYSTEM:WINDOWS /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:msvcrt.lib @"C:\Users\radia\AppData\Local\Temp\tmpE8D8.tmp"    Il2CppOutputProject    D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\Il2CppOutputProject\EXEC    1   
Error    LNK2019    unresolved external symbol openWindow referenced in function PopLink_openWindow_m704296A7FC6414855C0F7B2FE5FA68320A6C0C1E    Il2CppOutputProject    D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\Il2CppOutputProject\EB992E37F815CCE6565B9E89E0D21467.obj    1   
Error    LNK1120    1 unresolved externals    Il2CppOutputProject    D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\build\obj\il2cppOutputProject\x64\Debug\linkresult_36293C95F6921570993C1F6C23168A7D\GameAssembly.dll    1   
Error    MSB3073    The command ""D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\Il2CppOutputProject\\IL2CPP\build\deploy\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=Debug -platform=winrt -outputpath="D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\\build\bin\x64\Debug\GameAssembly.dll" --data-folder="D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\\build\bin\x64\Debug\\" -cachedirectory="D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\\build\obj\il2cppOutputProject\x64\Debug\\" -generatedcppdir="D:\ALL_CODE_STUFF\2022\Tenement\2022builds\uwp_d3d\Il2CppOutputProject\\Source"  --baselib-directory="F:\Program Files\Unity 2021.2.4f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\x64\Debug" --avoid-dynamic-library-copy --dont-deploy-baselib --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot-win32 -verbose --relative-data-path=Data/il2cpp_data -forcerebuild" exited with code 4.    Il2CppOutputProject    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets    54

This is the source of the issue:

unresolved external symbol openWindow referenced in function PopLink_openWindow_m704296A7FC6414855C0F7B2FE5FA68320A6C0C1E

You have a class named “PopLink” somewhere in your project, which has a method “openWindow” that has “[DllImport(”__Internal")]" attribute on it. That instructs IL2CPP to resolve the native method at link time. And it seems it’s nowhere to be found.

Are you using this method? If not, you can just delete it and the issue will go away. If you are using it, then you need to make sure that the source code for it is included in your project.

1 Like

Thanks for a response, means a lot to me. Thanks mate I did not realise the cpp had any decipherable relevance, you were totally correct, I learned something (the c++ has a comment line outlining what c# it replaces, its very interesting to view, its machine generated so not great to read BUT it references yourClass_yourmethod, so actually tracing this error was not too hard, I did agent ransack on project looked for poplink, found it, wiped in c# then rebuilt), wiped it (PopLink.cs) all worked. Weird one now thought im getting:

Severity Code Description Project File Line Suppression State
Error Certificate could not be opened: WSATestCertificate.pfx.
The specified network password is not correct.
Tenement C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets 826

Im assuming I need to supply a cert.

There’s “WSATestCertificate.pfx” in your project. Delete it and build the project again. The error should resolve itself.

1 Like