Jump to content

Linux IDE setup


jonny

Recommended Posts

Hello,

I'm new to addon development.
I made my first steps using Visual Studio. But I want to move to Linux for future development, because Linux mint 18.1-KDE (Based on Ubuntu 16.04) is my main OS. I figured out, that I have to compile my addons for .NET 3.5, which is not supported by the current MonoDevelop version. I tried to install MonoDevelop 3.12 using  the wheezy/snapshots/3.12.0 repository, but no success due to dependency issues.

Is there any solution, or will .NET 4.5 work just fine?

Link to comment
Share on other sites

I use a normal text editor and xbuild, optionally with a Makefile for packaging if it's something I need to build a lot. (I was not a fan of MonoDevelop's enthusiasm for creating extra files I didn't ask for or need, such as .sln. I'm on Ubuntu 16.10, for what that's worth.)

My csproj file has this, which I think is enough to satisfy the version requirement you mention:

    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

I'm able to compile that project without issues, and as far as I know my DLLs have worked fine for everybody that has tried them. I have tried opening and compiling the project in MonoDevelop as well, and that worked fine, so I'm not sure there's a problem here.

Edited by HebaruSan
Link to comment
Share on other sites

I tested your method, compiling a empty class but got 31 errors.

.csproj was generated by MonoDevelop 5.10 , and I changed the target framework version manually

Spoiler

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{B0C1A16D-D3D0-4B95-B5A1-70EF90FF2A1C}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>test</RootNamespace>
    <AssemblyName>test</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug</OutputPath>
    <DefineConstants>DEBUG;</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>full</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="MyClass.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

$ xbuild test.csproj created the following errors:

Spoiler

$ xbuild test.csproj
XBuild Engine Version 12.0
Mono, Version 4.2.1.0
Copyright (C) 2005-2013 Various Mono authors

Build started 16.03.2017 00:08:18.
__________________________________________________
Project "/daten/spiele/test/test/test.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+ /optimize- /out:obj/Debug/test

$ xbuild test.csproj
XBuild Engine Version 12.0
Mono, Version 4.2.1.0
Copyright (C) 2005-2013 Various Mono authors

Build started 16.03.2017 00:08:18.
__________________________________________________
Project "/daten/spiele/test/test/test.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+ /optimize- /out:obj/Debug/test.dll MyClass.cs Properties/AssemblyInfo.cs /target:library /define:DEBUG /nostdlib /reference:/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.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 "/daten/spiele/test/test/test.csproj".-- FAILED
Done building project "/daten/spiele/test/test/test.csproj".-- FAILED

Build FAILED.
Errors:

/daten/spiele/test/test/test.csproj (default targets) ->
/usr/lib/mono/4.5/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

         0 Warning(s)
         31 Error(s)

Time Elapsed 00:00:00.2452070

.dll MyClass.cs Properties/AssemblyInfo.cs /target:library /define:DEBUG /nostdlib /reference:/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.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 "/daten/spiele/test/test/test.csproj".-- FAILED
Done building project "/daten/spiele/test/test/test.csproj".-- FAILED

Build FAILED.
Errors:

/daten/spiele/test/test/test.csproj (default targets) ->
/usr/lib/mono/4.5/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

         0 Warning(s)
         31 Error(s)

Time Elapsed 00:00:00.2452070

while compiling the project with target framework v4.5 creates the following result:

Spoiler

$ xbuild test.csproj
XBuild Engine Version 12.0
Mono, Version 4.2.1.0
Copyright (C) 2005-2013 Various Mono authors

Build started 16.03.2017 00:07:57.
__________________________________________________
Project "/daten/spiele/test/test/test.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+ /optimize- /out:obj/Debug/test.dll MyClass.cs Properties/AssemblyInfo.cs obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs /target:library /define:DEBUG /nostdlib /reference:/usr/lib/mono/4.5/System.dll /reference:/usr/lib/mono/4.5/System.Core.dll /reference:/usr/lib/mono/4.5/mscorlib.dll /warn:4
        Target DeployOutputFiles:
                Copying file from '/daten/spiele/test/test/obj/Debug/test.dll.mdb' to '/daten/spiele/test/test/bin/Debug/test.dll.mdb'
                Copying file from '/daten/spiele/test/test/obj/Debug/test.dll' to '/daten/spiele/test/test/bin/Debug/test.dll'
Done building project "/daten/spiele/test/test/test.csproj".

Build succeeded.
         0 Warning(s)
         0 Error(s)

Time Elapsed 00:00:00.2877890

 

 

Edited by jonny
Link to comment
Share on other sites

Thanks, I see what you mean now. I checked my installed packages for things that might be relevant. Can you try this?

sudo apt-get install mono-reference-assemblies-3.5

The package description says, "This package contains files required to compile applications against an older version of .NET, using Mono 4.0 or above, which only include the latest version of the class library as-is. This is important for producing apps for wider distribution." Hopefully the package name is the same on your distro if it's based on Ubuntu.

Link to comment
Share on other sites

2 minutes ago, jonny said:

I got the reference-assemblie alrady.  (Same Name, because Linux Mint includes the Ubuntu repositorys)

What Version of mono do you have installed?

$ mono --version
Mono JIT compiler version 4.2.1 (Debian 4.2.1.102+dfsg2-7ubuntu4)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

 

Link to comment
Share on other sites

8 hours ago, jonny said:

I will try to install referenceassemblies-pcl as well, when I get home this evening.

I wish you luck, that package doesn't exist on my system.

I'm suspicious of the "4.0.0.0" in this part:

Quote

Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/test.dll MyClass.cs Properties/AssemblyInfo.cs /target:library /define:DEBUG /nostdlib /reference:/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll /reference:/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll /warn:4

The equivalent command from my xbuild looks like:

Quote

Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+ /out:obj/Release/Astrogator.dll (my project's source files) Properties/AssemblyInfo.cs /target:library /define:TRACE /doc:bin/Release/Astrogator.xml /nostdlib /reference:/usr/lib/mono/2.0/System.dll /reference:/usr/lib/mono/2.0/System.Data.dll /reference:/usr/lib/mono/2.0/System.Xml.dll /reference:KSP_x64_Data/Managed/Assembly-CSharp.dll /reference:KSP_x64_Data/Managed/UnityEngine.dll /reference:KSP_x64_Data/Managed/Assembly-CSharp-firstpass.dll /reference:KSP_x64_Data/Managed/UnityEngine.UI.dll /reference:KSP_x64_Data/Managed/KSPAssets.dll /reference:/usr/lib/mono/2.0/System.Core.dll /reference:/usr/lib/mono/2.0/mscorlib.dll /warn:4

So for whatever reason it's using the DLLs from .NET 2.0. Do you have mono-reference-assemblies-2.0 installed as well? Looking at those two packages in aptitude, the 2.0 assemblies are 16.2 MB while 3.5 is just 387 kB, so maybe 2.0 is needed to compile for 3.5.

Link to comment
Share on other sites

I solved the problem.

Because .NET 3.5 shares many libaries with .NET 2.0 I had to install mono-reference-assemblies-2.0 and *-3.5. I'm not sure why this is not listed as a dependency of mono-reference-assemblies-3.5 but it worked just fine.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...