C++ compiler for Linux on Windows? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm fully aware of this question asking for the same thing. That question is closed and rather old. Accepted answer suggests rather complicated way of making your own cross-compiler and it requires cygwin.
Maybe now there are some other, simpler ways of doing this?

Actually, there is.
If you want cross-compile for linux on ARM, you can use linaro toolchain, which is available for windows. It doesn't require cygwin.
If you want cross-compile for linux on x86, that's a bit of a problem. The only ready-to-use toolchain (apart pre-built solution in that answer) that I'm aware of is "cross-compile tools" for Intel Edison (here). There are some drawbacks to it:
It will compile 32-bit linux binary
Version for windows 64-bit requires cygwin
Version for Windows 32-bit doesn't require cygwin but contains case-sensitive filenames (i.e. there are some files with names that differ only in case and windows will consider them the same file). You may have to make your Windows case-sensitive.
Windows binaries will be at "sysroots\x86_64-pokysdk-mingw32\usr\bin\i586-poky-linux"
To use edison toolchain you have to provide it with sysroot option for compilation and linking, something like this:
"i586-poky-linux-g++.exe" --sysroot=../../../../core2-32-poky-linux

ELLCC is available as a binary download for Windows, Linux, and Macs. It doesn't require cygwin, and can build Linux programs for several targets, including ARM. It is based on the clang/LLVM compiler.

Related

Using C++17 to build ios apps? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
The latest XCode clang has support for c++17 but I'm not sure if older iOS devices (e.g., iPhone5, iPhone6) would have the libc++ library to support that. Is there a way to find out if I can use C++17 to build ios apps that supports all supported iOS versions?
Reference:
iPhone5, with iOS12 is still supported
https://support.apple.com/guide/iphone/supported-models-iphe3fa5df43/12.0/ios/12.0
The answer is yes, to some extent. If you're back-deploying to older OSes, there are things from C++17 you'll be able to use, and others you won't be able to use. Just try using it and you'll get a compiler error if it's not available on your deployment target. This requires telling the compiler your deployment target, which is usually done with -mios-version-min=<version> (or similar for other platforms).
Specifically, a feature X that is implemented in the system library (libc++.dylib) won't be supported on OSes older than the first version that shipped a libc++.dylib with support for X. Anything that does not require any sort of library support, i.e. that is all implemented in the headers, will work.
We maintain availability markup in the libc++ headers to flag when you're using something that would break on your deployment target. This is done by using attributes like __attribute__((availability(ios,strict,introduced=<VERSION>))) on declarations that depend on something in the shared library. The compiler does the rest of the job -- if you try to use a declaration that hasn't been "introduced" in the deployment target that you specify, it will let you know.
Edit: I'm using iOS as an example above, but this works for macOS, watchOS and all other Apple platforms.

How to get a C++17 environment on macOS High Sierra? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
macOS High Sierra and Xcode 9 come with an old version of LLVM. It's not obvious which version of LLVM it is because of version number mangling. However, it's apparent it's old as the latest version of LLVM supports C++17 but features like std::optional are not available.
I'd like to write some C++17 code using a Mac. What toolchains are available and what has the fewest complications to get working? My thoughts so far:
LLVM via Homebrew -- interference with/by Xcode?
GCC via Homebrew
Above compiled from source
Any preferred method?
This 'answer' is not an answer to your question. These are the handy bookmarks I use.
I'd use Homebrew to install clang++ (see link below). But if you really want Xcode to interop with it, I'd suggest the "bad news" of wait for Apple, or try out their latest beta. And keep in mind that Apple's "Objective-C++" (*.mm) probably requires Apple's secret sauce, if you have some sort of C++ / Cocoa project.
C++17 implementation status:
https://clang.llvm.org/cxx_status.html
Xcode -to- CLang version:
https://gist.github.com/yamaya/2924292
Homebrew to get CLang (clang++):
https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew

Are the boost-C++-libraries compatible with win98? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know, it sounds ridiculous but I was asked to make an application backwards-compatible with win98. Specifically, I am interested in the boost-thread library that I have used. So, where can I find information about which version of the boost libraries is compatible with which operating system?
It depends on which version of Boost you are interested in.
You can go through the Boost version history and search the Release Notes for one that lists a compiler that supports Win98.
A quick search hints that this is likely to be MSVS 2005. This means Visual C++ 8.0.
The latest version of boost that I've found to list this version of VC++ as a supported (and targetted) compiler is boost 1.52.0.
The Boost Thread library has been around since version 1.25.0, so this seems like an acceptable candidate.
Conveniently, the link to download the source code (of any particular version) are also provided on the version history page.
See http://www.boost.org/doc/libs/1_55_0/libs/log/doc/html/log/installation.html
It requires XP or newer, and at least VC8.

A good free IDE that installs with Boost for Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Does this exist? Can someone recomend one if it does. I was going to use minGW from the command line but Boost does not support minGW from the command line.
Figured I'd go ahead and try and install an IDE and Boost .
Edit Ok, none of these actually come with boost. I don't know of an IDE that does (and frankly I don't know why it should). Installing Boost is pretty simple as it is. I interpreted the question to be:
What nice windows IDE does support compiling with Boost?
VS Express 2010 C++: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
Code::Blocks and
eclipse CDT work with MingW
see http://ascend4.org/Binary_installer_for_Boost_on_MinGW
nuwen.net (thanks, Benjamin!)
My MinGW distribution ("distro") currently contains GCC 4.6.1 and Boost 1.47.0.
mingw-7.2.exe (16.8 MB) : This is a self-extracting archive. It's incredibly easy to install; see How To Install below.
I find BoostPro the easiest way to install pre-compiled boost binaries (libs, DLLs) and compiler pre-requisites (headers etc). http://www.boostpro.com/download/ (it's an installer that downloads whatever Boost modules you select and unzips them wherever you've told it to). All you need to do after that to use it is add the lib and include paths to your IDE/compiler. I personally recommend Visual Studio for Windows.

C++ Compiler for Windows without IDE? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm looking for just a compiler for C++ (such as g++) for Windows, that I could run in my cmd.
I'm using notepad++ as my text editor and I want to set up a macro in there that can compile my programs for me.
I do not wish to install Cygwin though.
Any suggestions?
MinGW. It's GCC/G++ for Windows. It's much lighter than Cygwin. The main difference from Cygwin GCC is that it doesn't try to emulate UNIX APIs, you have to use the Windows APIs (and of course the standard C/C++ libraries). It also doesn't provide a shell and utilities like Cygwin, just the compiler.
There is also a related system called MSYS, which provides a shell, etc. like Cygwin, but this is not required. MinGW itself will run in CMD (but I highly suggest using something better like Bash, for your own sanity).
Visual C++ has a command line compiler, cl:
Compiler Command-Line Syntax (C++)
If you don't have Visual Studio, you can download the Windows SDK (newer version) or the Windows Driver Kit for free, and then use the CL.EXE command-line compiler as suggested by #Greg Hewgill.
Digital Mars is excellent.
Probably not what you're looking for, but just to add to the question for completeness, the Intel Optimizing Compiler works great on Windows, Linux and Mac Intel platforms. A bit on the pricey side, but for highly optimized compiles on Intel processors it's second to none.
I think that the TDM-GCC from Twilight Dragon Media is more convenient than the official MinGW release. I found it simpler to install and use.
The old Borland C++ non-IDE compiler is freely available:
http://cc.codegear.com/Free.aspx?id=24778
Here is Wikipedia's background on this free, Windows, command-line compiler:
http://en.wikipedia.org/wiki/Borland_C%2B%2B
With Windows 10, you can use g++ via the Windows Linux Subsystem.
Once you've set it up, install g++ using the bash terminal (this answer on Ask Ubuntu shows you how).
Bear in mind: you will only be able to run compiled C++ programs in the Ubuntu/bash environment, not from cmd/PowerShell directly:
C:\Folder> bash
User#Computer:/mnt/c/Folder$ g++ hello_world.cpp -o hello_world
User#Computer:/mnt/c/Folder$ ./hello_world