knowledge-database (beta)

Current group: comp.emacs.

Emacs and C/C++ development

Emacs and C/C++ development  
Carl
 Re: Emacs and C/C++ development  
John Thingstad
 Re: Emacs and C/C++ development  
Marc Tfardy
 Re: Emacs and C/C++ development  
Klaus Berndl
 Re: Emacs and C/C++ development  
Daniel Lidström
 Re: Emacs and C/C++ development  
J.D. Ripper
From:Carl
Subject:Emacs and C/C++ development
Date:Wed, 12 Jan 2005 22:01:28 +0100
I would like to start programming in C/C++ on Linux. I've done it before on
Windows with MS VC++. What has prevented me from doing the same kind of
work with Emacs on Linux is my perception of the difficulty of writing make
files and the surrounding build procedure; and the need to keep track of a
large number of source files. I have a vague feeling that all this is
commonly done on a manual basis. Am I right?

What is the best approach/tools for C/C++ development in Emacs? I enjoy
editing source files in Emacs, but the construction of make files
troubles me.

What is the approach adopted by experienced C/C++ developers and Emacs
users? How do they "import" existing projects and make files and how do
they construct make files that make use of many source files? Do they use
any tools for doing this automatically or do they construct make files
manually? Are there any support for this in Emacs?

Are there any reference pages or documentation for guiding newcomers to C/C
+ development in Emacs?

Carl
From:John Thingstad
Subject:Re: Emacs and C/C++ development
Date:Thu, 13 Jan 2005 01:08:06 +0100
On Wed, 12 Jan 2005 22:01:28 +0100, Carl wrote:

> I would like to start programming in C/C++ on Linux. I've done it before
> on
> Windows with MS VC++. What has prevented me from doing the same kind of
> work with Emacs on Linux is my perception of the difficulty of writing
> make
> files and the surrounding build procedure; and the need to keep track of
> a
> large number of source files. I have a vague feeling that all this is
> commonly done on a manual basis. Am I right?
>
> What is the best approach/tools for C/C++ development in Emacs? I enjoy
> editing source files in Emacs, but the construction of make files
> troubles me.
>
> What is the approach adopted by experienced C/C++ developers and Emacs
> users? How do they "import" existing projects and make files and how do
> they construct make files that make use of many source files? Do they use
> any tools for doing this automatically or do they construct make files
> manually? Are there any support for this in Emacs?
>
> Are there any reference pages or documentation for guiding newcomers to
> C/C
> + development in Emacs?
>
> Carl

If you are used to VC++ you might find C++ BuilderX more to
your liking. It uses project files and has a graphical user interface.
Futhermore it is free for personal use.
It takes some of the tediousness out of writing portable code.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
From:Marc Tfardy
Subject:Re: Emacs and C/C++ development
Date:Fri, 14 Jan 2005 18:11:49 +0100
Carl wrote:
> I would like to start programming in C/C++ on Linux. I've done it before on
> Windows with MS VC++. What has prevented me from doing the same kind of
> work with Emacs on Linux is my perception of the difficulty of writing make
> files and the surrounding build procedure;

Writing make files is no problem at all. For programming
under Linux/UNIX I use only emacs (+compile, +gdb) - no "emacs IDE".
I rename some buffers to simple abbreviation (e.g. "PL"
for "ProfiledLine.cpp" or "cf" for "CubeFace.h"), I use
extensively emacs bookmarks and I put things like
C-x o or C-x 1 and some important gdb command on function keys.
This way of programming is for me much better, easier, friendly
as the big M$ cow VC++. I have everything under MY control
(hand made makefile) and I do all settings in ONE (or a few) file(s)
and not in thousands of windows. And last but no least - everything
without mouse!
Try this way and you will be never back to VC++ :-)

reagrds

marek
From:Klaus Berndl
Subject:Re: Emacs and C/C++ development
Date:13 Jan 2005 09:30:00 +0100
On Wed, 12 Jan 2005, phleum_nospam@chello.se wrote:

> I would like to start programming in C/C++ on Linux. I've done it before on
> Windows with MS VC++. What has prevented me from doing the same kind of
> work with Emacs on Linux is my perception of the difficulty of writing make
> files and the surrounding build procedure; and the need to keep track of a
> large number of source files. I have a vague feeling that all this is
> commonly done on a manual basis. Am I right?
>
> What is the best approach/tools for C/C++ development in Emacs? I enjoy
> editing source files in Emacs, but the construction of make files
> troubles me.
>
> What is the approach adopted by experienced C/C++ developers and Emacs
> users? How do they "import" existing projects and make files and how do
> they construct make files that make use of many source files? Do they use
> any tools for doing this automatically or do they construct make files
> manually? Are there any support for this in Emacs?
>
> Are there any reference pages or documentation for guiding newcomers to C/C
> + development in Emacs?

Just a pointer: There is ede ("Emacs Development Environment: A project
management system") which is part of the CEDET-suite (see
http://cedet.sf.net). With CEDET you get as "side-effects":

- very good parsing engine for C-code which offers browsing of all defined
variables, functions, macros etc...
- very good c++-parsing engine which offers browsing of all classes,
attributes, methods, templates etc...
- speedbar (a separate frame which displays all this parsed stuff for easy
overview and click-able jumps to tags

As a side effect of CEDET you can also install ECB (Emacs Code Browser) - see
http://ecb.sf.net - which offers a cute integrated IDE with different browsing
windows (see the screenshots section at the ECB-site) which gives you probably
that Emacs-based IDE which is closest to something you know with MS VC++
(ECB is alternative approach of browsing things compared to speedbar - its a
matter of taste...)

Klaus

>
> Carl

--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220
From:Daniel Lidström
Subject:Re: Emacs and C/C++ development
Date:Sun, 16 Jan 2005 18:41:52 +0100
Carl scribbled:

> I would like to start programming in C/C++ on Linux. I've done it
> before on Windows with MS VC++. What has prevented me from doing the
> same kind of work with Emacs on Linux is my perception of the
> difficulty of writing make files and the surrounding build
> procedure; and the need to keep track of a large number of source
> files. I have a vague feeling that all this is commonly done on a
> manual basis. Am I right?
>
> What is the best approach/tools for C/C++ development in Emacs? I
> enjoy editing source files in Emacs, but the construction of make
> files troubles me.
>
> What is the approach adopted by experienced C/C++ developers and
> Emacs users? How do they "import" existing projects and make files
> and how do they construct make files that make use of many source
> files? Do they use any tools for doing this automatically or do they
> construct make files manually? Are there any support for this in
> Emacs?
>
> Are there any reference pages or documentation for guiding newcomers
> to C/C + development in Emacs?
>
> Carl

I have a great makefile that automatically determines the
dependencies, and builds a separate makefile for each source file.
Only thing you need to do, is put all your source files in src/
directory, issue make dir, then make all. If you are interested, drop
me a note at daniel dot lidstrom at sbg dot se

--
Daniel
From:J.D. Ripper
Subject:Re: Emacs and C/C++ development
Date:Mon, 17 Jan 2005 00:09:00 GMT
Carl writes:


[...]

> What is the approach adopted by experienced C/C++ developers and Emacs
> users? How do they "import" existing projects and make files and how do
> they construct make files that make use of many source files? Do they use
> any tools for doing this automatically or do they construct make files
> manually? Are there any support for this in Emacs?

[...]

It will take a couple of hours or so to learn how to use them, but GNU
automake and friends make the process of constructing make files easy.
You can find lots of tutorials out there. Basically, you can run
autoscan to create a configure.ac file that you can edit to taste,
then you create a short, simple file called Makefile.am, and the rest
is done for you: you just run aclocal, autoconf, autoheader, and
automake (or even, to do everything in one shot, just autoreconf), and
then you are ready to ./configure && make. It is well worth learning
how to use these tools.

For small projects where you prefer to do things by hand, you can use
gcc's -MM switch to help you sort out dependencies.

--
J.D. Ripper
Email without "Re: " in subject line > /dev/null
   

Copyright © 2006 knowledge-database   -   All rights reserved