Mono compilation errors/ missing assembly references?

For questions or suggestions related to the source code.

Mono compilation errors/ missing assembly references?

Postby leezer3 on Fri, 9th May 2008, 16:23

Hiya,
I'm having a play with your source at the minute, with a view to getting it running under Linux :)
Couple of odd errors so far-
Code: Select all
OpenBve.sln(2,18): Error CS8025- Parsing error

Oddly enough the line reference is in the preprocessor statements, & I can't see anything that should cause this off the top of my head- Don't take this as verbatim, my coding skills aren't particularly brilliant! However, I'm presuming you may know slightly better what is going on than I can :)
Edit: MonoDevelop is parsing the files fine, looks like there may be an odd bug with locales somewhere- I'll look into it.

Secondly, had a prod with SharpDevelop under Windows, these are the errors here:
Code: Select all
Error loading code-completion information for Tao.FreeGlut, Version=2.4.0.2, Culture=neutral, PublicKeyToken=6e602a6ad6c0d06d, processorArchitecture=MSIL from ?:
Could not find assembly file.
Error loading code-completion information for Tao.Glfw, Version=2.6.0.0, Culture=neutral, PublicKeyToken=2bb092b6587e4402, processorArchitecture=MSIL from ?:
Could not find assembly file.
Error loading code-completion information for Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef, processorArchitecture=MSIL from ?:
Could not find assembly file.


I presume these are missing libraries that have been referenced in your source somewhere- Couldn't stick a link somewhere please?

Most I've really done to date with C# is medium-complicating scripting/ DLL stuff, nothing like this complicated!


Final, slightly OT comment- 0.3 is running rather nicely :)
I've got my route running relatively well, although transparencies need to be fixed for most stuff, and I've got a few missing bits here & there to be sorted.

Cheers

Chris Lees

http://www.bvecornwall.co.uk
leezer3
 
Posts: 33
Joined: Fri, 9th May 2008, 16:14

Re: Mono compilation errors/ missing assembly references?

Postby michelle on Fri, 9th May 2008, 17:47

I am using the Tao framework, which you should install, otherwise you can't compile at all. Site: http://www.taoframework.com.

I have not tested with Mono yet, however I did try the MoMA (Mono Migration Analyser), which only reported the obvious P/Invokes that Mono does not support. I defined a conditional compilation flag called WIN32, which only when set will use Win32-specific timing calls to the API, if not set, OpenGL timing functions will be used, so this part shouldn't pose a problem. As to the encoding, hopefully all files except MainLoop.cs are encoded in UTF-8 with a Byte Order Mark present. I don't know why the MainLoop.cs was not saved in UTF-8, but I will change that.

I plan to make the 0.5 beta compile with Mono. Then you should be able to directly compile for Linux. However, I guess that without major or any change it should even do now. If you use SharpDevelop for Windows, MS project files should be read correctly. I don't know if this is the case for MonoDevelop, maybe not.

Simply install the Tao framework first, then create a new project and import the source files, then reference "Tao Framework FreeGLUT Binding for .NET", "Tao Framework GLFW Binding for .NET" and "Tao Framework OpenGL Binding for .NET". Hopefully, it will compile without a change of source code. However, it could be that the texture loading routines in TextureManager.cs don't work, because they use some low level memory copy functionality, however only .NET code and the MoMA didn't complain about that, so... good luck.
User avatar
michelle
Site Admin
 
Posts: 1139
Joined: Mon, 14th Apr 2008, 20:36

Postby Jan on Fri, 9th May 2008, 17:55

There's also a quick and (maybe) dirty solution:
In SharpDevelop, go to Project -> Project Options and then Reference Paths. Now simply select the folder in wich your OpenBVE installation sits and click on "Add Path". Now it should compile without problems.

Jan
Jan
 
Posts: 132
Joined: Wed, 16th Apr 2008, 12:37
Location: Germany

Postby leezer3 on Fri, 9th May 2008, 18:15

Have been doing some tinkering since the last post anyhows :P
It compiles nicely on MonoDevelop in Ubuntu (Allowing for the fact I've spend the last hour getting the Tao framework to install- Mostly my fault, but the Ubuntu source package is broken to start with!), although I can't get it (Your code) to compile from the command line?!

The resultant executable works on the Windows install, but I can't get things running on Linux just yet- I've now got severe problems getting Mono to talk nicely to GLFW, but still; All fun & games :P

Cheers

Chris Lees

http://www.bvecornwall.co.uk
leezer3
 
Posts: 33
Joined: Fri, 9th May 2008, 16:14

mono v wine

Postby lezzloco on Fri, 9th May 2008, 18:16

Well I tested V3 last night in linux with wine, and .net 2, it still works why are you looking to mono, it seems like a dead duck, its also big and blouted, far too much trouble for me to mess with, plus the wine people are due to release version 1 any day now, which is the first stable version good enough for every day use.

People in "the bizz", don't seem very impresed with mono, (and thats being kind) so is there some major reason to use it ?, when wine works more or less out of the box.

Just checked Wine rc1 is out now
lezzloco
 
Posts: 102
Joined: Tue, 15th Apr 2008, 01:32
Location: Coventry

Re: mono v wine

Postby michelle on Fri, 9th May 2008, 19:26

Wine is only an emulation layer for Windows on Linux, while Mono would just-in-time compile to direct machine instructions. Therefore, performance-wise, there would be a good reason to get it to compile for actual Linux via Mono. Also, if the Linux community would be interested in the game, they would probably not like to be told to install a Windows emulation layer, but would want actual Linux executables to download. As I don't have Linux, all of this is totally up to you. If you manage to compile it and package everything for a Linux download (compatibility across distributions?), then it would be a nice thing for people to download without the need for Wine (but Mono), I guess.
User avatar
michelle
Site Admin
 
Posts: 1139
Joined: Mon, 14th Apr 2008, 20:36

Postby lezzloco on Fri, 9th May 2008, 19:59

I see, knew there must be a good reason, I can't code at all, or compile anything, so I dont really understand, I will wait for you to show us all the way when you get there.

Do you mean that in the end there will be a version for linux with mono incorperated as part of it, with no need for user's to install the mono part?

I do want to say that openBVE in linux with wine, already out performs original BVE in windoz.

Original BVE in windoz 20fps avg

OpenBVE in linux 25fps avg
lezzloco
 
Posts: 102
Joined: Tue, 15th Apr 2008, 01:32
Location: Coventry

Postby leezer3 on Sun, 11th May 2008, 18:45

lezzloco wrote:I see, knew there must be a good reason, I can't code at all, or compile anything, so I dont really understand, I will wait for you to show us all the way when you get there.

Do you mean that in the end there will be a version for linux with mono incorperated as part of it, with no need for user's to install the mono part?

I do want to say that openBVE in linux with wine, already out performs original BVE in windoz.

Original BVE in windoz 20fps avg

OpenBVE in linux 25fps avg


Doesn't quite work like that :D
C# is at the very basics of it a JIT language- IE. It needs to have the interperter/ compiler installed to run at all. Mono & .Net are designed to be cross-compatible, so one can run applications built for the other.
This means that on Linux you'll still have the .exe file (The extension is actually minorly misleading), but it'll execute natively on Mono.

Still haven't got GLFW running properly though, will post a complete howto if and when I get things to work right :)

Cheers

Chris Lees

http://www.bvecornwall.co.uk
leezer3
 
Posts: 33
Joined: Fri, 9th May 2008, 16:14

Postby michelle on Sun, 11th May 2008, 18:49

leezer3 wrote:Still haven't got GLFW running properly though...

As I need to use SDL (Simply DirectMedia Layer) for audio anyway, it seems I can use similar functionality for creating windows from within SDL. If that is in fact true (I will need to investigate), then I wouldn't need GLFW anymore. It's not my top priority to investigate this right now, but it could happen.

By the way:
Mono & .Net are designed to be cross-compatible
Mono is a .NET environment. Strictly speaking, you would mean Mono and Microsoft .NET, as both are .NET implementations.
User avatar
michelle
Site Admin
 
Posts: 1139
Joined: Mon, 14th Apr 2008, 20:36


Return to Source code

Who is online

Users browsing this forum: No registered users and 0 guests