Cross-compile C++11/14 on CentOS for Windows - c++

I've set up a CentOS 6.5 box running jenkins, among other things, which I want to use for building a project I'm working on with a couple of friends. It's designed to run on Windows, as we all have windows.
The problem I'm having is that I haven't found a cross-compiler that works on CentOS. Everything I've seen only works on Debian-based distros, and the few that I've found that have been presented as "working on red hat" don't actually work, or their methods of acquisition don't seem viable anymore.
It would be preferable that it supports C++11, or even C++14, as a couple of the guys I'm working on it with haven't ever delved into anything before C++11 and they're "scared of relearning half of what they know."
Everything I've searched for about MinGW or cross-compiling on CentOS has led to a dead end. Am I better off scrapping the installation and installing something debian-based like ubuntu server, or is there a cross-compiler that actually works to compile for windows on redhat distros?

You can use g++ C++ 11. For this you need to install it on your centOS machine. The installation procedure can be found on the following link - Install g++ C++ 11. I have been using this and it works fine.

Related

Compile Qt program on Ubuntu 18.04 which will run on Ubuntu 14.04

Interesting delema.
Trying to compile Qt program where Qt is build from source on 18.04 64-bit and run it on 14.04. The interesting part is trying to identify which libraries I need this time. The C++ ABI has changed.
Looking to see if anyone else has done this recently? Which libraries do I have to bring along? Yes, I know about ldd and readelf and have spent days trying this in various VMs. The problem is once you start bringing the C++ stuff over (because the ABI has changed yet again) you get to a point where your VM won't reboot.
Please don't suggest snappy, flatpak or one of those other new "container" solutions. Already wasted 3+ days on snappy. It's architecture specific and only supports building on 14.04 when it comes to Qt, at least the deployqt tool to make an AppImage does.
Did this years ago with this very program. Built a debian which would install on both 64-bit and 32-bit for every version from 12.04 to 15.04 including the short lived .10 and odd year versions.
I tried compiling QT with C++11 standard, but, it will no longer compile with that standard.
The incompatible ABI is the real killer.
It is more than one program so the hack of a shell script using LD_LIBRARY_PATH would bring considerable difficulty.
Appreciate insights.
Thank you.
Please always develop applications on the oldest distribution you still want your application to run on. For example, if you want your application to run on all currently still-supported versions of Ubuntu, then develop your application on Ubuntu 14.04 and do not install any newer compilers or libraries than what it comes with.
This is how "backward compatibility" works.

Choosing a default gcc/g++ compiler

Im running Matlab on linux (Elementary OS)
The problem im facing is that Matlab isnt compatible with the gcc compiler higher than 4.9.
Same question as: https://www.mathworks.com/matlabcentral/answers/348906-downgrading-gcc-g-for-use-with-mex
When I use "sudo apt get install gcc" 5.4 is automatically installed. When I remove 5.4, Matlab will not recognize 4.9 which I've installed. How do I get Matlab to recognize gcc/g++ 4.9 as my compiler?
I've also followed this but it didnt resolve the problem:
https://www.mathworks.com/matlabcentral/answers/137228-setup-mex-compiler-for-r2014a-for-linux#answer_263109
Any help would be greatly appreciated.
When I remove 5.4, Matlab will not recognize 4.9 which I've installed. How do I get Matlab to recognize gcc/g++ 4.9 as my compiler?
I use Ubuntu (from which you OS is derived) and have had a similar issue. Basically, you can use update-alternative to switch between gcc versions on your choice. Here is a link that explains how to do it.
Here is the documentation on update-alternative, if you need more in-depth knowledge of its functionalities.
Note that uninstalling the default gcc for your distro (5.4 in your case) is no longer required with this solution: you can switch back to it for you development when not using Matlab. You can even install more than two versions of gcc if needed.
Hope this solves your issue.
There is no reason to downgrade GCC for MATLAB.
The reason you run into issues on Linux is because MATLAB installs its own copies of the GCC libraries. If your MEX-files expect newer libraries, they'll fail. You can delete the GCC libraries that come with MATLAB, and it will use the newer ones on your system.
The libraries are at $(MATLABROOT)/sys/os/glnx86 for 32-bit MATLAB, and $(MATLABROOT)/sys/os/glnxa64 for 64-bit MATLAB. $(MATLABROOT) is the installation root for MATLAB.
The files in question are libgcc_s.so*, libstdc++.so* and libg2c.so* (or at least they used to be called like this, I don't have a Linux MATLAB installation here to double-check).
This trick worked for MATLAB 7.0, and still worked a month ago when I suggested this to a colleague.
I do recommend that you rename or move the files, so you can replace them if things go sour.
You will need to restart MATLAB after this change, of course.

Compile vowpal-wabbit in ubuntu for use in windows 7

I have a Windows 7 laptop with an Ubuntu 12.04 installation on the same machine.
I am trying to compile a program from source (VowPal Wabbit). I tried using Cygwin but had no luck getting it to work. I ended up installing Ubuntu 12.04 to get access to get a functioning compiler.
It worked on the Ubuntu side but I am curious if there is a way to bring the compiled files over to Windows as that's where I actually do most of my work. More specifically, will programs compiled in Ubuntu function on a Windows machine?
Any suggestions?
You should check out MinGW:
MinGW, a contraction of "Minimalist GNU for Windows", is a minimalist
development environment for native Microsoft Windows applications.
I realize it is almost a year later. Credit Chris Quirk, Nick Nussbaum and others, current versions of vowpal wabbit (7.x) should build and work fine on Windows.
This reference should provide all the necessary details.
Edit: 2017-07-10:
I should also note: the library and basic train and test from files functionality has been working on Windows for a while. However, not all the functionality supported in a native Linux environment is available on Windows. In particular, the --daemon option, network related features like spanning-tree (under the cluster directory), and some of the utilities under the util directory have not been fully ported and/or tested on Windows. vw developers welcome pull-requests from Windows users.

Making Eclipse for C++ developers compile

I've downloaded Eclipse for C/C++ for Mac OSX. I'm running Snow Leopard. Now, when trying to run the Hello World application on Eclipse, it is complaining that
What might be the issue? Maybe I don't have (or Eclipse can't find) where my C++ compiler is? If that is the issue, what should I install and how should I proceed so that Eclipse recognizes it?
It looks like gcc is not in your path. Try adding the path to gcc (should be in /usr/bin by default) to your PATH environment variable and relaunch Eclipse.
You can also try adding it to Eclipse's preferences. I believe you'll find an item in the eclipse preferences which will allow you to point eclipse at the location of gcc. This would come in handier then benw's answer in my opinion because you're not changing anything with the system itself. Developing often involves setting things up specific to your development environment. Although it seems like gcc would be on your PATH already if it were installed. Have you installed Apple's developer tools by any chance?
Thanks.
Since I cannot comment on that comment you just put above. Install the Apple Developer tools. You can go here to download them. I just used gcc on my work mac today, and I never installed gcc specifically so it had to have been installed when I installed the developer tools.

How easy (or difficult) is it to migrate to a development environment on Mac from Ubuntu

I am used to Ubuntu, I like it, I know my way around it.
I am looking forward to upgrade my work laptop.
I find the awesome hardware that a Macbook Pro is made of, a turn-on.
Now, having never used a mac before, I'd like to know how easy it is to move my development environment to a mac from being on Ubuntu.
My work is primarily web application development using the django framework.
I love the apt-get install and the package managers and such stuff that Ubuntu provides. Are there equivalents on a mac?
What are the other things I need to know to move my development environment to a Mac?
I moved from ubuntu to Mac 6 months back, the tools that you get in Mac are awesome(like iweb) and most of the application work out of the box without compilation. There are alternative for apt-get in Mac, I use port, fink which works pretty much like apt-get. I would say list down all your favorites tools in ubuntu mostly you will find the same in Mac or its equivalent.
Should be pretty easy. MacPorts is like a package manager for installing open source software and libraries.
I do some django work and moved from Windows to Mac recently. I found it very easy since django is Python which is pre-installed in Mac OS X, but can be upgraded if necessary. I also use Eclipse with the PyDev plugin which all runs on Java.