all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Compilator en windows
@ 2012-09-19 11:50 Jose Cristino Cepeda Uceta
  2012-09-19 16:36 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Jose Cristino Cepeda Uceta @ 2012-09-19 11:50 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

i am new to emacs. I install emacs on windows and I want to configure it to work with the MinGW compiler but not how 		 	   		  

[-- Attachment #2: Type: text/html, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compilator en windows
       [not found] <mailman.9307.1348070151.855.help-gnu-emacs@gnu.org>
@ 2012-09-19 16:15 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 3+ messages in thread
From: Pascal J. Bourguignon @ 2012-09-19 16:15 UTC (permalink / raw)
  To: help-gnu-emacs

Jose Cristino Cepeda Uceta <cristiamuz@hotmail.com> writes:

> i am new to emacs. I install emacs on windows and I want to configure
> it to work with the MinGW compiler but not how

Compiling from emacs, is usually done with M-x compile RET
By default, it runs the make command.

So you'd write a Makefile with rules to call the MinGW compiler.

Writing Makefile doesn't concern emacs (emacs just provides an editing
mode for Makefiles, with nice colorization).  So read the documentation of
your make program.

Calling the MinGW compiler doesn't concern emacs (emacs just provides a
compile mode to launch a compiler, and to analyse error messages).  So
read the documentation of your MinGW compiler.


I know the usual unix or GNU make, but often on MS-Windows people use
another make, with I guess a different syntax.  The principle would be
the same.  On unix you'd write a Makefile like this:

----(Makefile)----------------------------------------------------------

# variables: specific to the compilation of a specific program

EXE=mypgm
OBJ=mymodule.o mypgm.o
INCS=-I.
LIBS=-lm

# CC is usually predefined by make; but you can also define it to point
# to a specific compiler; you'd put the path to the MinGW compiler here.

CC=gcc


# rules: always about the same.

all:$(EXE)

$(EXE):$(OBJ)
    $(CC) -o $@ $< $(LIBS)

.o.c: ; $(CC) -c $(INCS) -o $@ $<

# dependencies: depend on the specific program; can also be generated
# automatically from the sources.

mymodule.o : mymodule.h mymodule.c
mypgm.o    : mymodule.h mypgm.c

------------------------------------------------------------------------


If you have a simple single source file program, you can also often
compile it just calling the compiler, without a Makefile.  Then you can
edit the command line proposed by M-x compile to call directly the
compiler:


    M-x compile RET C-a C-k   gcc -o mypgm *.c -lm    RET
                              ^^^^^^^^^^^^^^^^^^^^

Having read the documentation of the MinGW compiler, you would
substitute the part underlined by "^^^^" with the right MinGW compiler
invocation.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compilator en windows
  2012-09-19 11:50 Compilator en windows Jose Cristino Cepeda Uceta
@ 2012-09-19 16:36 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2012-09-19 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Jose Cristino Cepeda Uceta <cristiamuz@hotmail.com>
> Date: Wed, 19 Sep 2012 07:50:47 -0400
> 
> i am new to emacs. I install emacs on windows and I want to configure it to work with the MinGW compiler but not how 		 	   		  

No configuration required.  If you have MinGW installed, type
"M-x compile" followed by the command you'd type at the shell prompt
to compile your program.  For example:

   M-x compile RET

Emacs will show:

  Compile command: make -k

If you don't have a Makefile, delete "make -k" and type the GCC
command like "gcc hello.c -o hello.exe" and hit RET.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-19 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19 11:50 Compilator en windows Jose Cristino Cepeda Uceta
2012-09-19 16:36 ` Eli Zaretskii
     [not found] <mailman.9307.1348070151.855.help-gnu-emacs@gnu.org>
2012-09-19 16:15 ` Pascal J. Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.