logo elektroda
logo elektroda
X
logo elektroda

Compiling BK7231Flasher Tool for Fedora Linux: Mono and XBuild Errors

arjen2 696 2
ADVERTISEMENT
  • #1 20813674
    arjen2
    Level 3  
    Dear Forum

    I have abandoned Windows and running Fedora for a while now. Recently I dug into the Openbeken software and managed to burn a smart switch. However, I had a really hard time getting a Windows computer up and running, especially because the USB/COM port driver is not standard on (my) Windows version. In the end I managed, but I again now realised why I abandoned Windows.

    I read in the BK7231Flasher readme that it could be possible to compile this UI software for linux. So I git-cloned the flasher software, installed Mono and gave it a try.

    Alas, lot's of errors and a warning.
    I am not familiar with mono, xbuild or any other software that might be used here. I tried some searches on the errors I got, but that did not make sense (to me).

    The output:

    sudo xbuild
    [sudo] password for arjen: 
    
    >>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
    
    XBuild Engine Version 14.0
    Mono, Version 6.12.0.199
    Copyright (C) 2005-2013 Various Mono authors
    
    Build started 11/13/2023 7:14:18 PM.
    __________________________________________________
    /home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
    Project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln" (default target(s)):
    	Target ValidateSolutionConfiguration:
    		Building solution configuration "Debug|Any CPU".
    	Target Build:
    		Project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher/BK7231Flasher.csproj" (default target(s)):
    			Target PrepareForBuild:
    				Configuration: Debug Platform: AnyCPU
    			Target GenerateSatelliteAssemblies:
    			No input files were specified for target GenerateSatelliteAssemblies, skipping.
    			Target CoreCompile:
    				Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:full /debug:portable /optimize- /out:obj/Debug/BK7231Flasher.exe /resource:obj/Debug/BK7231Flasher.FormDownloader.resources /resource:obj/Debug/BK7231Flasher.FormExtractedConfig.resources /resource:obj/Debug/BK7231Flasher.FormMain.resources /resource:obj/Debug/BK7231Flasher.FormOBKConfig.resources /resource:obj/Debug/BK7231Flasher.FormPin.resources /resource:obj/Debug/BK7231Flasher.FormPrompt.resources /resource:obj/Debug/BK7231Flasher.Properties.Resources.resources BitUtils.cs BK7231Flasher.cs BKFlashList.cs Colors.cs ConfigBase.cs CRC.cs FormDownloader.cs FormDownloader.Designer.cs FormExtractedConfig.cs FormExtractedConfig.Designer.cs FormMain.cs FormMain.Designer.cs FormMain_Net_Scanner.cs FormMain_Net_SingleDevice.cs FormMain_TuyaConfigExtractor.cs FormOBKConfig.cs FormOBKConfig.Designer.cs FormPin.cs FormPin.Designer.cs FormPrompt.cs FormPrompt.Designer.cs ILogListener.cs MiscUtils.cs ModifyProgressBarColor.cs MySettings.cs OBKConfig.cs OBKDeviceAPI.cs OBKFlags.cs OBKFlashLayout.cs OBKMassBackup.cs OBKRoles.cs OBKScanner.cs Program.cs Properties/AssemblyInfo.cs Rand.cs RequiredLibrariesCheck.cs TuyaConfig.cs RFPartitionUtil.cs RichTextUtil.cs SecurityProtocolTypeExtensions.cs TuyaModules.cs Properties/Resources.Designer.cs Properties/Settings.Designer.cs /target:winexe /win32icon:bk_icon.ico /define:"DEBUG;TRACE" /nostdlib /platform:AnyCPU /reference:../packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.dll /reference:/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll /reference:/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll /reference:/usr/lib/mono/gac/System.Deployment/4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll /reference:/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll /reference:/usr/lib/mono/gac/System.Net/4.0.0.0__b03f5f7f11d50a3a/System.Net.dll /reference:/usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll /reference:/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll /reference:/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll /warn:4
    CSC: error CS0518: The predefined type `System.Object' is not defined or imported
    CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported
    CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int32' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int64' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported
    CSC: error CS0518: The predefined type `System.Single' is not defined or imported
    CSC: error CS0518: The predefined type `System.Double' is not defined or imported
    CSC: error CS0518: The predefined type `System.Char' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int16' is not defined or imported
    CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported
    CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported
    CSC: error CS0518: The predefined type `System.SByte' is not defined or imported
    CSC: error CS0518: The predefined type `System.Byte' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported
    CSC: error CS0518: The predefined type `System.String' is not defined or imported
    CSC: error CS0518: The predefined type `System.Enum' is not defined or imported
    CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported
    CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported
    CSC: error CS0518: The predefined type `System.Void' is not defined or imported
    CSC: error CS0518: The predefined type `System.Array' is not defined or imported
    CSC: error CS0518: The predefined type `System.Type' is not defined or imported
    CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported
    CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported
    CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported
    CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported
    CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported
    CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported
    CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported
    CSC: error CS0518: The predefined type `System.Exception' is not defined or imported
    			Task "Csc" execution -- FAILED
    			Done building target "CoreCompile" in project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher/BK7231Flasher.csproj".-- FAILED
    		Done building project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher/BK7231Flasher.csproj".-- FAILED
    	Task "MSBuild" execution -- FAILED
    	Done building target "Build" in project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln".-- FAILED
    Done building project "/home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln".-- FAILED
    
    Build FAILED.
    
    Warnings:
    
    /home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
    
    Errors:
    
    /home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher.sln (default targets) ->
    (Build target) ->
    /home/arjen/bk7231_tools/BK7231GUIFlashTool/BK7231Flasher/BK7231Flasher.csproj (default targets) ->
    /usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->
    
    	CSC: error CS0518: The predefined type `System.Object' is not defined or imported
    	CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Int32' is not defined or imported
    	CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Int64' is not defined or imported
    	CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Single' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Double' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Char' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Int16' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported
    	CSC: error CS0518: The predefined type `System.SByte' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Byte' is not defined or imported
    	CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported
    	CSC: error CS0518: The predefined type `System.String' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Enum' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported
    	CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Void' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Array' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Type' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported
    	CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported
    	CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported
    	CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported
    	CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported
    	CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported
    	CSC: error CS0518: The predefined type `System.Exception' is not defined or imported
    
    	 1 Warning(s)
    	 31 Error(s)
    
    Time Elapsed 00:00:00.9533510
    


    Could some linux Guru point me to a possible solution? Thanks!
  • ADVERTISEMENT
  • #2 20814324
    p.kaczmarek2
    Moderator Smart Home
    It seems that some libraries are missing, here is a similiar problem:
    https://github.com/travis-ci/travis-ci/issues/4076
    https://stackoverflow.com/questions/27594393/...t-libraries-system-object-is-not-defined-or-i
    Have you tried changing target framework version or including the missing libraries?
    Helpful post? Buy me a coffee.
  • #3 20814792
    arjen2
    Level 3  

    Thanks for the reply. I did find these comments earlier, but since I am not into this .NET stuff, I didn't get the significance. I added the suggested property to the xbuild. Lo and behold: Most errors are gone. One to go.....

    (and again I have no clue what this error means or what to do) Normally I would try and study this, but it is like learning Japanese just to hit the one button you're looking for.

    So again: Please help

    sudo xbuild /p:TargetFrameworkVersion="v4.0"
    (There's a lot more output, but somehow I am not allowed to post that, maybe it has some forbidden phrases. So the Error is:)


    BKDeviceAPI.cs(125,61): error CS0012: The type `System.Configuration.ConfigurationSection' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=
ADVERTISEMENT