Menu
F2C based Fortran: This is the oldest Fortran compiler available for OS X. Its been around since OS X was in a public beta state. Download this shell script: buildf2c, type chmod +x buildf2c and then sudo./buildf2c. The script will grab f2c source from Netlib repositories and install a f2c based compiler in /usr/local/. You are done!
2020腾讯云7月秒杀活动,优惠非常大!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1040
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1040
Code review; Project management; Integrations; Actions; Packages; Security. PFUnit is has been ported to Linux and Apple OS X. Users have also contributed support for Windows/CYGWIN, but please note that updates are not regularly verified in that environment. Due to the heavy use of F2003 object oriented features and a smattering of F2008 features, only relatively recent Fortran compilers are able to correctly build.
Dec 24, 2012 I did have one issue: I was unable to x-compile code that used C11 futures/promises. To use these, gcc needs to be build with the flag –with-arch=armv6. In ct-ng menuconfig, if I go to the item: Target options - Architecture level, and set it to “armv6” (without quotes), then I am able to cross compile code that uses futures/promises. Apr 11, 2020 Building Clang. OSXCross uses clang as the default compiler for building its tools, and also as a cross-compiler to create OSX binaries. In clang there is no difference between cross-compilation and native compilation, so OSXCross can use a normal clang install for both. I learned (the hard way) that Intel C and Fortran compilers refused to do anything with each other (e.g. Linking a library created by Intel C version 11.x.y with Fortran linker version 11.k.p). So, if you must go the Intel path, download compilers of identical version. The system is huge! I ended up downloading more than 3GB of programs!
2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址:https://www.aliyun.com/minisite/goods
入口地址:https://www.aliyun.com/minisite/goods
up vote 60 down vote favorite 32 I have written some effects in C++ (g++) using freeglut on Linux, and I compile them with g++ -Wall -lglut part8.cpp -o part8
So I was wondering if it is possible to have g++ make static compiled Windows executables that contains everything needed? I don't have Windows, so it would be really cool, if I could do that on Linux :) c++ opengl gcc glut freeglut
|
this question edited Sep 26 '16 at 19:56 Rakete1111 16.1k 7 31 64 asked Jan 9 '10 at 16:27 Louise 1,614 9 25 32 4 @AndiDog, 'First dose for free', right. Anyway, setting up automated build process on Windows machine, while you have a completed and working one for Linux, is unnecessary. – Pavel Shved Jan 9 '10 at 16:51 How would you test your Windows software without Windows? Using Wine? – el.pescado Jan 9 '10 at 17:01 3 @el.pescado, building and testing are completely different tasks. Windows is unnecessary for the former. – Pavel Shved Jan 9 '10 at 17:10
| 7 Answers|
this question edited Sep 26 '16 at 19:56 Rakete1111 16.1k 7 31 64 asked Jan 9 '10 at 16:27 Louise 1,614 9 25 32 4 @AndiDog, 'First dose for free', right. Anyway, setting up automated build process on Windows machine, while you have a completed and working one for Linux, is unnecessary. – Pavel Shved Jan 9 '10 at 16:51 How would you test your Windows software without Windows? Using Wine? – el.pescado Jan 9 '10 at 17:01 3 @el.pescado, building and testing are completely different tasks. Windows is unnecessary for the former. – Pavel Shved Jan 9 '10 at 17:10
up vote 50 down vote ---Accepted---Accepted---Accepted---
mingw32 exists as a package for Linux. You can cross-compile and -link Windows applications with it. There's a tutorial here at the Code::Blocks forum. Mind that the command changes to mingw32-gcc, for example. EDIT: Debian Linux, for example, has MinGW in its repositories: $ apt-cache search mingw
mingw32 - Minimalist GNU win32 (cross) compiler
mingw32-binutils - Minimalist GNU win32 (cross) binutils
mingw32-runtime - Minimalist GNU win32 (cross) runtime
Cross-compile Fortran For Os X 7
gcc-mingw32 - The GNU Compiler Collection (cross compiler for MingW32)
...
|
this answer edited Jan 9 '10 at 16:46 answered Jan 9 '10 at 16:31 AndiDog 41.6k 10 115 175 1 If you use debian, mingw32 is already in the repository, together with few precompiled libraries too. – liori Jan 9 '10 at 16:45 Yes just added it to my post as you wrote your comment :) Thx – AndiDog Jan 9 '10 at 16:47 to be complete, you'd need to provide a mingw-compatible glut library too, no ? – Bahbar Jan 9 '10 at 17:26 1 Well, there's a cross-compilation environment at nongnu.org/mingw-cross-env. It includes freeglut, for example. But I haven't used this, so don't ask me about it ;) – AndiDog Jan 9 '10 at 17:44 1 Does the '32' in mingw32 mean that I can only produce a 32-bit binary? Is there a solution to produce a 64-bit binary as well? – bluenote10 Jul 28 '15 at 14:12 | show 3 more comments up vote 19 down vote One option of compiling for Windows in Linux is via mingw. I found a very helpful tutorial here. To install mingw32 on Debian based systems, run the following command: sudo apt-get install mingw32 mingw32-binutils mingw32-runtime To compile your code, you can use something like: i586-mingw32msvc-g++ -o myApp.exe myApp.cpp You'll sometimes want to test the new Windows application directly in Linux. You can use wine for that, although you should always keep in mind that wine could have bugs. This means that you might not be sure that a bug is in wine, your program, or both, so only use wine for general testing. To install wine, run: sudo apt-get install wine
|
this answer answered Jul 19 '13 at 7:30 aggregate1166877 773 7 21 4
Cross-compile Fortran For Os X 4
Recommend:c++ - How to change arm version in arm-linux-gnueabi-gcc for cross compile
alled ARM cross compiler toolchain, using below commands. $ sudo apt-get install emdebian-archive-keyring$ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross$ sudo apt-get install binutils-arm-linux-gnueabi$ sudo apt-get instal
you do not need to specify mingw32-binutils and mingw32-runtime because they are dependencies of mingw32 – henje Oct 22 '14 at 11:21 cool, the cpp had very simple errors ( void main(){} etc...), I guess it compiles at windows but fails at mingw, I fixed them. I tried also i586-mingw32msvc-cpp and it generated a text file with something like things to be compiled lol.. the g++ one worked, thx! – Aquarius Power Dec 7 '16 at 1:15 | up vote 5 down vote I've used mingw on Linux to make Windows executables in C, I suspect C++ would work as well. |
this answer answered Jan 9 '10 at 16:31 Richard Pennington 16.2k 3 28 57 3 ...........How? – Kaiden Prince Oct 30 '15 at 17:01 1 Since I posted that answer, I've gone a bit further. I have a project, ELLCC, that packages clang and other things as a cross compiler tool chain. I use it to compile clang (C++), binutils, and GDB for Windows. Follow the download link at ellcc.org for pre-compiled binaries for several Linux hosts. – Richard Pennington Oct 30 '15 at 20:32 | up vote 3 down vote From: https://fedoraproject.org/wiki/MinGW/Tutorial As of Fedora 17 it is possible to easily build (cross-compile) binaries for the win32 and win64 targets. This is realized using the mingw-w64 toolchain: http://mingw-w64.sf.net/. Using this toolchain allows you to build binaries for the following programming languages: C, C++, Objective-C, Objective-C++ and Fortran. 'Tips and tricks for using the Windows cross-compiler': https://fedoraproject.org/wiki/MinGW/Tips
|
this answer answered Feb 23 '14 at 3:37 iljau 1,102 1 7 20 | up vote 3 down vote Install a cross compiler, like mingw64 from your package manager. Then compile in the following way: instead of simply calling gcc call i686-w64-mingw32-gcc for 32-bit Windows or x86_64-w64-mingw32-gcc' for 64-bit Windows. I would also use the --static option, as the target system may not have all the libraries. If you want to compile other language, like Fortran, replace -gcc with -gfortran in the previous commands.
|
this answer edited Apr 16 at 22:14 answered Jan 13 '16 at 19:01 Pedro Miranda 31 2 | up vote 1 down vote for Fedora it's sudo yum groupinstall -y 'MinGW cross-compiler'
|
this answer answered Oct 20 '14 at 14:00 scavenger 61 4
|
this answer answered May 3 at 14:10 bcag2 9 4 1 Yes there are other answers giving similar bad answers, but well: your answer doesn't give a real answer. If it at all, it should be a comment. Or you should edit and
it. – GhostCat May 3 at 14:32 |
Recommend:c++ - Use GCC on Linux to cross-compile Qt apps for Windows
, on 64-bit Linux using GCC, but for a 64-bit Windows target. Again ideally, I want the result to run on 64-bit Windows without any additional runtime support, just as if we had compiled the same source code in Visual Studio. Is this possib