-
Notifications
You must be signed in to change notification settings - Fork 51
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
Building on Linux #45
Comments
Could you please run the same command in the terminal to see if it works properly? |
It was run in the terminal. |
I assume you build CppSharp yourself because the binaries in the repo are (for now) Windows-only. In turn, this means you built QtSharp too. With this in mind, please debug the call. It's performed by a method called ProcessHelper.Run at https://github.com/ddobrev/QtSharp/blob/master/QtSharp.CLI/Program.cs#L110 . When you debug it, you'll be able to see if the qmake executable you pass exists, as well as check for any other irregularities. |
I did some poking, so the path When I ran via the terminal again, I got this error:
I also tried to run in the debugger, It kept on running until it hit this line: https://github.com/ddobrev/QtSharp/blob/master/QtSharp.CLI/Program.cs#L202 Where Monodevelop told me that it lost connection with the debugger. |
I think you didn't update the binary references. They are only for Windows. For Linux you need to build https://github.com/mono/CppSharp yourself because while we have Linux CI for it at https://travis-ci.org/mono/CppSharp/jobs/123573796, we do not upload binaries yet. Once you have, you need to replace the references to CppSharp with your build and this error is going to disappear. |
I'm sorry for not being more attentive with this. I'm finishing up school right now, I should be able to revisit this in less than a month. Also, if I were to port some of the Qt examples to C#, would you be willing to merge them into this repo? |
I won't be willing but happy to. :) Please just have in mind that API-s which require support for templates, such as QObjectList QObject::children(), are not available yet. I've been working on it and I hope I'll have it done in a month. |
I've tried to take the release .dlls and include them in a MonoDevelop project on Ubuntu Linux. I was able to build the following small program, when when constructing the using System;
using QtGui;
using QtCore;
using QtWidgets;
namespace First
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
QColor clr = new QColor("red");
Console.WriteLine(clr.Red);
Console.WriteLine(clr.Green);
Console.WriteLine(clr.Blue);
}
}
} Here are the details of the error:
|
I think you will need to compile your own version of Qt# for Linux, the releases are specific to Windows. I got it to compile on OSX a few months ago, so making it work on Linux shouldn't be too much work. @define-private-public What step are you stuck on when compiling Qt# from source code? |
I was hoping that the .dll would world on a whim. Guess not. : P Looking at the Qt Sharp build documentation, that's where I'm getting confused. If you would be able to document what you did step by step to get QtSharp built on OS X, that would be the best thing you could do for me. |
Well, the way I did it was by using Premake. You can find the build scripts on the build folder. First you need to compile CppSharp from scratch, by following the guide on the repository: https://github.com/mono/CppSharp/blob/master/docs/GettingStarted.md#building-from-source After you have that built, you can call CppSharp's You can also generate project files for Xamarin Studio, by invoking with the VS action, something like: Give it a try and I will try to help if you get stuck on any step. Once you get QtSharp generator compiled, then we look into generate the Linux bindings from the Qt source files. |
I'm at the last part of this document: https://github.com/mono/CppSharp/blob/master/docs/GettingStarted.md#compiling-on-linux Where I run
|
I suspect you're hitting this issue. The issue has been fixed but the build scripts have not been yet fixed to auto-detect recent GCC versions and choose the correct triple. Try to change the triple in the build files and re-generate the project files to try a new build. |
I tried changing the triple in the linked comment, but it looks liked it moved somewhere else in a more recent version of CppSharp. Is this the correct line to change?: https://github.com/mono/CppSharp/blob/master/src/CppParser/Bindings/CSharp/premake5.lua#L30 And if it was, I tried changing it to
Is there anywhere else the triple needs to be changed? |
Hi. It's been a while since I last left a message. Has there been any change on the Linux side of things? |
@define-private-public QtSharp cannot be properly generated on Linux because of a bug in CppSharp - mono/CppSharp#764 . I have unfortunately been too busy lately to either fix that bug or set up a Linux virtual machine. Unless you are able to give a hand, I would expect the problem to be fixed in June-July. |
I need QtSharp to be run on linux 32-Bit. |
Hi, Still haven't done anything in a while. I see that the one CppSharp bug is closed. I noticed that @wolfgangmauer is looking for 32 Bit support. Is 64 bit support there at least? |
Well, its not only linux-32. It need' to run on a Settop-Box (ARMV7) like raspi. |
I try out CppSharp and QtSharp, both do not compile/run on linux(Ubuntu-x64). |
I think the main thing is to focus on getting it to work under one platform then worrying about other platforms afterwards. Although I'm hoping to help out later on by proposing some changes / pull requests to use.
I'm currently working on a .Net core version of Gtksharp (gtk3) / scons stuff to see how that goes. |
@grbd So, if you are working on Gtksharp make Gtk work on egl-only systems! |
I'm not working on Gtk or the GtkSharp code per say. Instead I'm working on the build scripts that surround GtkSharp to make it more portable / usable on .Net core, then I'm going to use that on some of my other projects. (a lot of that was bash and perl scripts / required a lot of fiddling in mingw to get it to work) The actual code for GtkSharp is mostly just a copy / paste from: Personally if I had a choice I'd use Qt since I'm not sure Gtk would survive long term and I like the idea of CppSharp generated code. Also looking at the interfaces on these Ships that use Qt, that's some straight up star-trek type stuff right there |
How can I update the binary references to CppSharp in the QtSharp build directory ? |
@maxime-vienne please try the latest C++#, 0.8.17. |
I think I am already using it.
Do I need to change the references in QtSharp.csproj ? How do I find where the nuget package is installed ? |
Are you trying to generate Qt# for Linux or on Linux? I am afraid the latter does not work yet because the NuGet packages are for Windows only. |
Oh, so I need to build the CppSharp dlls from source ? I thought that the NuGet packages were available for linux too, because I was able to install them with Sorry, I'm new to this. |
I am afraid not so you'd have to build it from source code. |
I tried grabbing the latest release .tar.gz file. I was able to restore the nuget packages (via the command line), and build both the
|
I am afraid the NuGet packages only work on Windows 64-bit. To run Qt# on Linux, you need to build C++# for Linux and then replace the managed references. |
Ah, okay, I was confused on that. I think I did try building C++# from this document a while ago: https://github.com/ddobrev/QtSharp/blob/master/Docs/4.%20Building%20-%20CppSharp.md But I got hung up somewhere. I see that it hasn't been updated in about two and a half years. Are the steps still good? |
I am afraid not, they are for Windows only. Basically, you need to build C++# from source using its own instructions, and then replace the references in the Qt# project files. |
I've been trying to get QtSharp working for a bit now and I still keep on having issues with getting it working on Linux.
I got to the point where I had to tell the
QtSharp.CLI.exe
app where myqmake
andmake
utilities are stored. I supplied the application with the full path, but when trying to do that, I got this error:The text was updated successfully, but these errors were encountered: