I have tried to follow the GRPC guides and i couldn't make it compile for windows (it does compile for android + it run well from editor). the error i get when i try to compile on windows is: Code (CSharp): Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe /out:"D:\projects\MyGame\Client\MyGame\Library\il2cpp_cache\linkresult_097C944A02A3A505631BAA50279D30EE\GameAssembly.dll" /ignore:4206 /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" "E:\Program Files\Unity\2020.3.3f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" /SUBSYSTEM:WINDOWS @"C:\Users\Me\AppData\Local\Temp\tmp3D01.tmp" Creating library D:\projects\MyGame\Client\MyGame\Library\il2cpp_cache\linkresult_097C944A02A3A505631BAA50279D30EE\GameAssembly.lib and object D:\projects\MyGame\Client\MyGame\Library\il2cpp_cache\linkresult_097C944A02A3A505631BAA50279D30EE\GameAssembly.exp 6F8E1B7554AB08145EB7D8161E97FEAB.obj : error LNK2019: unresolved external symbol dlopen referenced in function Mono_dlopen_m7F2DE2CD0870AB15EEA4E0A0BA6C47044E74BB67 6F8E1B7554AB08145EB7D8161E97FEAB.obj : error LNK2019: unresolved external symbol dlerror referenced in function Mono_dlerror_m359ABCFD23D0EB5314DE2DFF8AB58CFE949BBABD 6F8E1B7554AB08145EB7D8161E97FEAB.obj : error LNK2019: unresolved external symbol dlsym referenced in function Mono_dlsym_m31A00C09F598C9D552A94628C2C28B3C7B04C2DD D:\projects\MyGame\Client\MyGame\Library\il2cpp_cache\linkresult_097C944A02A3A505631BAA50279D30EE\GameAssembly.dll : fatal error LNK1120: 3 unresolved externals at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext) at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles) at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions) UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <c9b5231e365148a4bc210cc4e439206d>:0) DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <c9b5231e365148a4bc210cc4e439206d>:0) DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <c9b5231e365148a4bc210cc4e439206d>:0) DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <c9b5231e365148a4bc210cc4e439206d>:0) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <c9b5231e365148a4bc210cc4e439206d>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) i have tried to google it but couldn't get it to work with the various workarounds i saw
solved by adding the following: Code (CSharp): void dlopen() { fprintf(stderr, "Should never reach here"); abort(); } void dlerror() { fprintf(stderr, "Should never reach here"); abort(); } void dlsym() { fprintf(stderr, "Should never reach here"); abort(); } into "grpc_csharp_ext_dummy_stubs.c" under "Plugins/Grpc.Core/runtimes"
that help compiling and running on windows but on android the app will crash on startup -> so i have to manually change this file when i compile to win/andorid -> any idea how to "avoid" that?