Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Visual Studio 6 C++ compiler from within Emacs

I'm just getting started with c++ development and I would like to use emacs to write the code and then compile and run it from within emacs using the visual studio 6 compiler. I have already googled around a bit but just can't seem to find an explanation of how this is done. Any pointers?

Thanks for your help,

joerg

like image 694
jörg Avatar asked Jun 04 '09 20:06

jörg


2 Answers

I have done this as a matter of course over the past few years. There are two ways to do this:

  1. In the older versions of VS (including VS 6.0), there is a button to export the nmake file for the project. I do this on occasion and then use nmake to compile. I have

    (setq compile-command "nmake debug ")

    in my .xemace/init.el for this. You have to add the name of the nmake file, and nmake.exe has to be in your path. (BTW, I modified compilation-error-regexp-alist-alist to help moving through the errors. Let me know if you want this as well.)

  2. Newer versions of VS do not have the button to export the nmake file. For these I call devenv.com. In this case I have

    (setq compile-command "devenv.com /build Debug ")

    in my .xemacs/init.el. You have to add the name of the .sln file. Although I did not do this with VS 6.0, I believe that it may work as well.

like image 61
Andrew Stein Avatar answered Sep 20 '22 22:09

Andrew Stein


I am not sure if you would consider merely swapping the text editor inside of Visual Studio with Emacs, but here is a sf.net project which does just that.

http://sourceforge.net/projects/visemacs/

like image 29
John Bellone Avatar answered Sep 20 '22 22:09

John Bellone