• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

GNU GCC Compiler Under Cygwin.

Hello all,

I am now writing out C++ codes on school computer, which has Linux system installed. I am used to use Emacs to edit my C++ code. The Emacs program installed on my school computer has been modified by my school's IIT team so that I can actually debug and compile my program in the Emacs window.

I want to be able to work on C++ on my own computer, which has Windows 7 installed instead of Linux. However, I want to still use GNU GCC compiler instead of the Microsoft Visual C++ compiler. I heard Cygwin will be a good choice. Does anyone have a complete step-by-step manual to show me how to install and configure Cygwin in my Windows 7? Also, does anyone know how to make it possible to debug and compile a program in the Emacs Window, please?

Thank you very much.
 
Install setup.exe from http://www.cygwin.com/

Then run setup.exe, which will give you a screen from which you need to select which mirror site from which to download cygwin, and a menu which will show a tree of all the various downloadable modules, of which there are many. If you choose to download everything, it will take up several gigabytes on your disk, and take a long time. So, you may wish to shut off those things that you think you won't need, by unchecking the boxes for such modules. Cygwin then does a reasonably automated job of downloading and installing whatever you have requested, though it can take a long time depending upon the amount of stuff on your list -- over an hour if your connection isn't the fastest and if you are asking for everything.
 
Install setup.exe from http://www.cygwin.com/

Then run setup.exe, which will give you a screen from which you need to select which mirror site from which to download cygwin, and a menu which will show a tree of all the various downloadable modules, of which there are many. If you choose to download everything, it will take up several gigabytes on your disk, and take a long time. So, you may wish to shut off those things that you think you won't need, by unchecking the boxes for such modules. Cygwin then does a reasonably automated job of downloading and installing whatever you have requested, though it can take a long time depending upon the amount of stuff on your list -- over an hour if your connection isn't the fastest and if you are asking for everything.
Thank you very much for replying. I did what you said, and the Cygwin is running smoothly. I am more used to edit using Emacs in a mouse-friendly Emacs interface, instead of running everything in the Shell using keyboards. But I can try get more used to that.
Thank you very much again for your advice.
 
There should be "Cygwin-X" group in your system menu, and "XWin Server" item there - run this one, and then either run emacs from the shell window that will pop-up, or run "export DISPLAY=:0.0" and then "emacs &" from your Cygwin shell window.

Alternatively, you may wish to install an Emacs distribution for Windows, like this one. But overall, if you're more comfortable doing your work in Unix environment, I think the best option is just to install some Linux distribution, either in virtual machine, or alongside your Windows installation.
 
If you have opted to install it, cygwin should include a program called "xemacs", which runs emacs under an X-server, with all the mouse-friendly features that you prefer. However, you do have to configure the X-server and the application default settings in order to get the windows the way that you like them. Usually it is easiest to copy the config files from someone else who already has it working, rather than wrestling with it yourself.
 
If you have opted to install it, cygwin should include a program called "xemacs", which runs emacs under an X-server, with all the mouse-friendly features that you prefer. However, you do have to configure the X-server and the application default settings in order to get the windows the way that you like them. Usually it is easiest to copy the config files from someone else who already has it working, rather than wrestling with it yourself.
Thank you for replying. I already searched through online and did find out a .emacs file that would set it to work. Now I am practicing using keyboard commands to edit using Emacs in the shell and surprisingly it is not as complicated as I thought it would be. Thank you very much for your feedbacks, and now I have two alternatives to have it work out!
 
try this:http://tdm-gcc.tdragon.net/ TDM-GCC one key install for windows; commands line compile is a good choice, but make your own eamcs IDE is a funny work for time consuming.

Thank you for your advice. I just downloaded it but did not know how to use it.
I could not find the user's manual. Would it be possible if you could tell where I might be able to learn how to use this? For example, the command lines for editing, compiling, debugging, etc. Thank you very much.
 
Thank you for your advice. I just downloaded it but did not know how to use it.
I could not find the user's manual. Would it be possible if you could tell where I might be able to learn how to use this? For example, the command lines for editing, compiling, debugging, etc. Thank you very much.
First of all, make sure TDM-GCC installed correctly,open command line window type in "gcc -v" and return, there a lot of information show in the window, and the end line of those information,you will find the vesion of the gcc,it's should be 4.6.1, that means it's installed correctly. you can choose cross plantform IDE codeblock ,here:http://www.codeblocks.org/, two tpyes, one with mingw(packed compile like vc), and one without mingw(so you can use your TDM-GCC). About the command line compiling, I think it's the same as cywin,point to the path where you put your hello.cpp,and type "g++ hello.cpp -o hello" return. It's hard to find systematic GCC learning resource, so just check on the google when your meet the problem.
 
Thank you for your advice. I just downloaded it but did not know how to use it.
I could not find the user's manual. Would it be possible if you could tell where I might be able to learn how to use this? For example, the command lines for editing, compiling, debugging, etc. Thank you very much.
And,GSL:http://sourceforge.net/projects/mygsl/files/, a nice scientific computation library, easy to use, a nice partner for GCC.
 
Top