tags:

views:

100

answers:

3

Hi, Where could I find C++ libraries in my emacs? I have already installed emacs on my computer and already using it lately. I just want to add boost libraries in emacs so I could use them.

A: 

You need to supply them in your make script, or you can set an environment value for GCC. Take a look at this question.

Hassan Syed
+3  A: 

Emacs is a text editor, it doesn't compile your code. It doesn't know (or need to know) anything about your libraries.

However, there are commands for running the compiler from inside emacs, I've never done it myself, I use command line compiling and makefiles for bigger projects.

I would write the program using the boost libraries (or any libraries) just like normal. I'm guessing you'd use GCC to compile as you're using emacs to edit. When compiling you need to tell the compiler (GCC) where to look for the header files and the libraries.

For example, in your program you will have a line like

#include <library.h>

then compile it using

g++ myprogram.cpp -I/path/to/header/files -L/path/to/library

If your program is more than a couple of files, I would recommend writing a makefile for it and including all the required compiler flags and search paths in the makefile.

Dom
Oh I forgot, emacs is just an editor. My mistake. By the way, i'm using the MinGW g++ compiler.
James
A: 

You could use CEDET to setup parsing of header files. Please look to my CEDET config for example

Alex Ott
Hey alex, how well does CEDET cope with auto-completion and boost ?
Hassan Syed
I hadn't tried it hard with boost, but as i remember some of libraries worked without problem. For libstd it works for almost all headers
Alex Ott