Porting an application from Linux to Windows [closed] - linux

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have one application, which has been developed on Linux (gcc based), I need to port the entire application to Windows.
Can you suggest me which tool/interface should choose to build the environment?
If I choose Visual Studio, will it support GCC compiler tool chain or which one is suitable among MinGW and Cygwin ?
Please give me some Inputs and the challenges will there while porting.
Thanks...

I would recommend an abstraction layer for all your OS-dependent routines. You then provide two implementations of those routines. One for Linux, one for Windows, and you compile one or the other depending on the current platform. You should keep the portable code well separated from the platform-specific code.
Of course you could also use an already existing platform abstraction layer, like Qt's Core module (which provides abstractions for threading and I/O) or the Network module, which provides portable networking. Of course I cannot determine whether this is suitable in your case or not, since I don't know what kinds of system calls you need or if C++ is even acceptable, but it might be worth looking into it (or other similar portability libraries.)
As a compiler, you can actually build the Windows binaries under Linux. I've been doing that for a long time now, since I'm not a Visual Studio kind of guy. I prefer the likes of CMake or Autotools. For that, I recommend MXE.

Well, GCC is just the copiler. I assume they are just c or cpp files so just compile them in windows with a windows compatible c/cpp compiler.

Related

Why linux doesn't support different software versions at the same time? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
We can take any programming language, it has package manager that can install lib-v1 for program1 and lib-v2 for program2.
When new version of lib is released on linux you can't predict what of your programs will break after update. Let me remind, linux is popular on servers where stability has the highest priority.
For example, many programs were broken by major release of openssh.
So, why? Every programming language can afford such feature, and linux can't?
Why Linux doesn't support different software versions at the same time?
It's not true. For example NixOS and Guix support multiple packages versions.
If you ask why Debian or RedHat does not support multiple software version then I'd say it's because of its legacy. In the early days of Linux era, disk space was expensive so it shared libs was the way to reduce required space. Windows has the same problem aka DLL hell.
Every programming language can afford such feature, and Linux can't?
It's not true. For example in java, you have JAR hell and can use the only single version of your dependency. I'm not sure if you can find the language where you can use multiple versions of the same lib at once. You can do it, but it's not supported by default. E.g., in Java you can repackage your dependency to a different name.

Is linux any good for programming? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm thinking of buying a netbook with linux installed for school and at home, but i'm not sure. Because i want to use it for things such as word as well as doing some coding.
Is there a terminal in it?
I've also heard that it can't run .exe is this true?
P.s what are the best linux netbooks and operating system? Thanks!
I would like to program in:
Python
Javascript
Ruby
and also would like to do some web development
Programming
I think that Linux is really great for programming. Installing other libraries is really a breeze. I would wholehardedly recommend Linux for Programming in:
C
C++
Python
Java
PHP
JavaScript
Haskell
Lua
Lisp
You can also do C# with the Mono toolchain, but I am not sure how compatible that is with the C# and .NET from Windows.
On Windows, I find programming a pain. C does not really work (unless you use Visual Studio maybe), Java works pretty well. Python works also kind of well.
If you want to develop games that run with DirectX, Windows is your only option. OpenGL seems powerful as well, and that runs everywhere.
Word
Doing “Word” stuff should be okay with LibreOffice or OpenOffice.org. It might not be super compatible with Microsoft Word, but you should do fine.
Linux Distro
Go with Ubuntu, maybe Xubuntu or Lubuntu on a Netbook. If you do not like Ubuntu, openSUSE and Fedora would be my next recommendations.
Hardware
Try to get as much Intel hardware as possible, that usually works flawlessly.
All of them.
For newbies I recommend Debian or Ubuntu but it depends on personal preferences.
Ubuntu has app center where you can find a lot of useful apps. Ubuntu has also great support for graphic interface.
Try it for free here.

Porting C++ OpenCV program to Ubuntu [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a complete program that uses opencv which I have written in C++ on Microsoft Visual Studio 2010. I have now been asked to assess the possibility of getting the program running on a Ubuntu server, of which I have no experience.
As such, my questions are:
1 - Does any one have a good tutorial for porting applications from C++ Windows to Ubuntu?
2 - on a scale of 1-10 (1=easy) how difficult would this be?
3 - Ubuntu will be running on a server, does this make a difference to OpenCV?
I have had zero experience with Ubuntu so a step by step guide would be really great if anyone can help!
many thanks for your help,
Kay.
If you have written your program in standard C++, you will have no problem compiling. The problem might be for example in linking the libraries you are using. Depending on the complexity of your project, you might have to find an adequate building system, like cmake. It's better if you implement the latter first in Windows. Did you build yourself OpenCV? Do the same for Ubuntu, DO NOT USE the distribution OpenCV packages available with Ubuntu.
If you have somebody that knows about Ubuntu assisting you, it will be much smoother.
No difference, if you use it like a normal work station. If you access remotely, you might have to solve some visualization issues.

Having a hard time tracking down all linux dependencies for Qt based app [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have my app working on OSX and Win, but am having a hard time tracking down all of the required dependencies for Linux. Ideally I'd like to be able to run it on Fedora, CentOS and possibly Ubuntu. Ubuntu is lower priority however.
Will someone help me figure this out? I can get my way around Linux decently well but am not a pro. This has me quite stumped.
http://www.genecrucean.com/tmp/KickAssGUI.tar.gz (It's a simple GUI app for a 3D renderer called Arnold. www.solidangle.com)
Currently your tarball contains the binary .so files for Qt 5. This is usually not the way to do it on Linux. You can either provide the source code of your program and let the users build it for themselves, or you can kindly provide a pre-built package (.rpm or .deb) for the Linux distribution in question. This means building packages specifically for a certain release of Fedora, again for CentOS, and again for Ubuntu. These packages would depend on libqt5, a package provided by the Linux distribution itself.
For finding out more dependancies, use ldd:
$ ldd program
Running the same compiled binary across different Linuxes is usually a no-no because of differences in the versions of the underlying shared libraries, although some companies do it, namely for commercial games.
If you use static linking then it can work. Until they change something big in the kernel.
You should also take the target architecture into consideration: ia32, amd64, or maybe something else.
Maybe this question is better answered at ServerFault.

Haskell for mobile development [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know its possible to use haskell with web development, but what about for mobile development? Since Haskell runs almost flawlessly windows, Linux, and Mac, I can't see why this wouldn't be possible.
GHC does support ARM to some extent, so you could compile Haskell programs to run on most mobile phones.
That said, there's very little library support for Haskell mobile applications on the big platforms (iOS and Android) at the moment. The issue is that they use custom system and UI libraries that aren't (really) available outside their ecosystems. You could interface Haskell code with Android or iOS apps (probably via the C bindings), but there's no automated way of it, and there's no simple library to use. So, although you could write some Haskell program that computes something, getting input from a user, and showing them the result would be quite a hassle (see the relevant HaskellWiki articles on Android and IPhone).
Your best bet at the moment would probably be Maemo, which should be able to run GTK Haskell apps for ARM without much hassle. That said, there aren't many Maemo phones out there. There are also a few other mobile distributions that just run vanilla Linux systems and those would work just as well; in particular, any tablet that runs a vanilla Linux (as opposed to Android, or some other heavily customized distribution) would probably run even graphical Haskell apps just fine.

Resources