How to import XCode project to linux? - linux

I have an XCode project with SWIFT programming language, I would like to build it on Linux.
How can I build this project on linux?
Thanks

You cannot directly use the xcode project on linux.
You can run swift on linux so you can copy the swift files from the xcodeproject and build them after installing swift compiler on linux. Also, UIKit is not available on linux so you cannot use any code that needs to import UIKit. Foundation is available but it is not completely available eg. NSJSONSerailization is not yet available on linux.

Related

Convert DLL from Windows to LINUX

I'm using the lastest DELPHI version 10.2.3 with LINUX support and I already managed to compile a console application using the platform LINUX 64 bit and execute this code on my UBUNTU client computer.
Now I wanted to convert a larger project for LINUX.
Question is now : for a exsting DLL which compiles fine for with WIN64, how to add now LINUX support, the add platform buttom in Delphi does not provide the LINUX 64 BIT platform for the existing project
It is not possible to add platform, that wasn't available, when project was created. To fix this, you will need to delete dproj-file and let IDE recreate it.

Unity 3d installing Standard assets for Linux/Ubuntu

I have installed Unity 3d on my Linux system.I have downloaded the Window version of the standard assets (.exe) since there is no option for installation in Linux, I tried installing the Standard assets(.exe) through wine... but im getting an error that unity requires windows 7 or more... But since this is Linux i cant help it.Is there any other way?
You can't expect .exe program to work on Linux out of the Box without the help of visual machine or some other software such as Wine. You don't even need the exe program to install the Standard Assets. You can get it directly from the Asset store from your Linux.
It's recommended that you use other OS at this time because the Linux version of Unity is still in experimental mode and you may have problems with it in the future.
You just download unity using the following link,
Unity 5.1 for Linux
It will contains standard asset also. Don't forget to select standard assets while installing.

Swift on OS X compiling for Linux?

I'm confused by the build process for Swift on other platforms.
Does Swift allow me to build a Linux project on OS X, or do I need to use Swift specifically on Linux to to build anything I plan on using there?
I looked at the documentation, but it's not really clear on this topic...
A pure Swift application which is not importing any framework can now be compiled for iOS, OS X and for Linux.
You will generate different executables, because it's different platforms, but the code source can be the same, it just has to be compiled for the respective platform.
The difference is when you import frameworks.
If you import UIKit to make an iOS application, obviously you won't be able to compile this on Linux, because Linux doesn't have those iOS UIKit libraries, they're only available on a Mac via Xcode.
If you import Cocoa to make an OS X application, the same logic applies, it works only for OS X.
The same way, you can make Swift code that only works on Linux if you import specific Linux libraries, like Glibc, that won't work on the Mac.
Etc, etc.
What you need to remember is that the programming language isn't that relevant when it comes to make applications for a platform, it's the frameworks and libraries that you're linked to that are decisive.
Different Swift versions come with different compilers (different toolchains, actually) so to answer directly, no you can't compile for Linux Swift with the normal OS X Swift compiler, you have to use the Swift.org's one.
The Swift Package Manager got custom toolchain support via
PR-1098
end of April 2017.
This allows you to setup cross compiler toolchains (macOS to Ubuntu, even the reverse).
The SwiftPM repo contains an example script which sets up a Intel-macOS => Intel-Ubuntu toolchain.
As Eric says, you can of course only use frameworks available on the target platform. But yes, you can now build a Linux Swift project on macOS. (as mentioned by joels in the comment you can also do this via Docker very easily)
Related: (Cross-)Compiling Swift for Raspberry PI
Update 2021-10-19: There are ready-made cross compilers available as a Homebrew tap: SPMDestinations

Deploy to Linux

Background:
Im using QT and have visual studio 2012 as my IDE (used the QT plugin for visual studio).
And finally the whole project is done. However due to my .NET background I have no experience when it comes to deploying my project so it can be run on Linux.
Question:
Anyone knowing how to deploy a QT project made in visual studio to linux?
You should install Linux and prepare a Qt development environment on it.You can then copy your project there, compile it and see the results in the real environment. This way you can cope with the minor differences when porting from one OS to another easily.
So don't think of cross compiling your app for Linux on Windows. From a complexity point of view, I think setting up a Linux machine (VM or not) and the necessary environment for Qt is a whole lot simpler than cross compiling bug hunting afterwards. After all you will need a real target environment to finally test your application.
Before you can deploy something you have to compile it for that platform, and here you have two main choiches: either you cross-compile which means you compile it on windows using a set of tools so that your software is built to run on a linux, or you get a linux machine, you copy your entire project over and let Qt for linux do the magic.
Once you have your working binary compiled on linux or for linux then you start thnking about deployoment.
If you really want to be fully linux-compatible and "linux-ally correct" you should distribute your source-code precooked using some tools like "automake" that will make it possible to linux users to compile it on any linux version.
If you do not want to release your source code, you technically can distribute binaries without source code (not sure if you will be ok with licenses) but you have to be aware that there is no standard in linux for distributing binary packages, there are at least 2 main package building standards that are the ubuntu/debian style and red hat (and friends) style.
You are going to find plenty of documentation about all this stuff from cross-compile to automake and of course building debian packages and building red hat rpm packages.

Running Qt application built for Linux, on windows

I have a Qt application which I built on Linux. I would like to run the same application on Windows. Is it possible? If yes, how? The Qt application software that I downloaded and used, is version 4.7.4.
Is it possible? If yes, how?
Yes, it is possible if the application is cross-compiled for Windows target on Linux.
You would need to have the mingw compiler installed on the Linux box when building the application for Windows. You would also need to make sure to use the proper `-mkspec- option for qmake.
If this is missed while building the application on Linux, it is probably not cross-compiling, so you would not be able to run the code on Windows off-hand unless you have a virtual machine installed for Linux, in which case you could do it, for sure.
You can install a Windows alongside your Linux and install VS2010 and Qt 4.8.* libraries for windows and compile your project there. You may need to make some changes to your source code in order to be compatible with Qt 4.8.* .

Resources