Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile on Ubuntu #149

Open
cmbasnett opened this issue Feb 16, 2020 · 11 comments
Open

Unable to compile on Ubuntu #149

cmbasnett opened this issue Feb 16, 2020 · 11 comments
Assignees
Labels

Comments

@cmbasnett
Copy link
Contributor

I followed the instructions to the letter on the readme, but I am getting the following error when trying to compile:

/home/colin/openviii/Core/ImGuiRenderer.cs(37,37): Error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. (CS0012) (Core)

I've tried adding the netstandard assembly as a reference to the project, but that doesn't seem to work. Any help is much appreciated!

@Sebanisu Sebanisu added the LINUX label Feb 16, 2020
@MaKiPL
Copy link
Owner

MaKiPL commented Feb 18, 2020

Please try getting the NuGet package for "Netstandard" of version 2- let us know if it would work

@cmbasnett
Copy link
Contributor Author

cmbasnett commented Feb 19, 2020

I've used NuGet to add the NETStandard.Library package, but the same error occurs.

I'm reading up on other people encountering this same error (dotnet/standard#481). Is it possible that changing the projects to use the new PackageReference style of package management could fix this error? I'm using MonoDevelop, so I don't have the option to easily convert the project to this new style, apparently this is something you can do with VS though.

@MaKiPL MaKiPL self-assigned this Feb 21, 2020
@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 4, 2020

I found 3 code errors I made that prevents Linux from building. Though I am having trouble with the shader compiling on Ubuntu. I fiddle more today. I'm trying to get appveyor to build on Ubuntu. So I am on a VM testing terminal commands to script out the build. #152

@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 4, 2020

MonoGame/MonoGame#4313 Shaders cannot be compiled on linux. Windows only.

@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 4, 2020

Okay we did some trickery so when we build the opengl shader on windows it'll be copied to the linux version and we can commit it with git.
I got it to build.
Here is my script
https://github.com/MaKiPL/OpenVIII/blob/master/linuxAutoBuild.sh
Though I still need to test the script on a clean install. And monodevelop has plugins for monogame that need to manually be installed if you want to develop in linux. But to compile you don't need monodevelop.
related #142

@cmbasnett
Copy link
Contributor Author

cmbasnett commented Mar 4, 2020

Making progress!

There were a few problems I encountered:

Memory.Init calls

I had to change a few lines to get the whole suite compiling: there are 4 or so calls to Memory.Init in some of the tool projects which are missing the fourth argument. They all used to be:

Memory.Init(null, null, null);

I had to change them to:

Memory.Init(null, null, null, null);

Missing FFmpeg libraries

After changing that, I was able to compile and get the program executing now, but ran into a missing DLL error:

System.DllNotFoundException has been thrown
Unable to load DLL 'avutil.56': The specified module could not be found

I had previous installed ffmpeg, so was confused as to why the libraries were not being picked up. I did a little searching, and apparently the LTS versions of Ubuntu haven't updated their ffmpeg package references to use FFmpeg 4, so it was downloading an old version.

I followed this guide to reinstall the new version of ffmpeg. I was then able to load the game into the main menu, hurray! 🎊

Shaders

Regarding shader compilation: unless I'm mis-remembering, isn't the output of shader compilation dependent on the GPU? So any compiled shaders put onto the repo would only be guaranteed to work on the GPU it was compiled on? I'd be happy to be wrong about this.

EDIT: Speak of the devil, attempting to go to the World Map shows this error:

Screenshot from 2020-03-04 12-53-26

It appears to be failing on this line:

worldShaderModel = Memory.content.Load<Effect>("testShader");

Note that turning bUseCustomShaderTest to false allows the game to run just fine.

@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 4, 2020

We made added a precompiled shader to the OpenGLLinux project. It will copy that to the bin folder. This is generated when we compile opengl on windows. Sadly no one has ported the Shader compiler to linux or mac. It only works on windows. MonoGame/MonoGame#4313

@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 4, 2020

Though if the shader isn't working still on linux maybe we need to ignore shaders on linux. I got it compiled on my vm but I haven't ran it yet heh. I should probably do that

@Frenzied-Pop
Copy link

Frenzied-Pop commented Feb 19, 2021

Had issues with https://github.com/MaKiPL/OpenVIII/blob/master/linuxAutoBuild.sh
Tried a fresh install, no go. This is is as minimal as I could get.

sudo apt install mono-devel nuget snapd
sudo snap install dotnet-sdk --classic
nuget install MonoGame.Framework.DesktopGL
nuget install MonoGame.Framework.DesktopGL.Core
nuget install MonoGame.Framework.OpenGL
git clone https://github.com/makipl/openviii
cd openviii
dotnet msbuild OpenVIII.sln /target:OpenGLLinux /property:Configuration=DebugLinux /property:Platform=x64

Throwing 1 error:

@Sebanisu
Copy link
Collaborator

Sebanisu commented Nov 4, 2021

I had updated the readme with new instructions. Back in July.
c419e61

Monogame had moved things around so I had to update the links.

@Sebanisu
Copy link
Collaborator

Sebanisu commented Nov 4, 2021

#189 refers to this link:
https://github.com/Sebanisu/CleanPNG/blob/master/.github/workflows/codeql-analysis.yml

That project uses the same version of monogame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants