Question

I'm trying to make a simple email client and I have to parse mime messages which I then print in a QT interface. I read that gmime would do the job great, but g++ doesn't seem to be aware of the existence of the library. So far I have tried

sudo apt-get install libgmime-2.6-dev
sudo apt-get install libgmime2.6-cil
sudo apt-get install libglib2.0-dev
sudo apt-get install libgmime2.6-cil-dev

First thing I did really. It seemed to work well, but then

#include <gmime/gmime.h>

doesn't work (gmime.h not found). I checked /usr/include and the headers are all there, but no other sign of the library in my file system.

Afterwards I followed these instructions http://www.linuxfromscratch.org/blfs/view/svn/general/gmime.html , but when I ran

./configure --prefix=/usr --disable-static &&
make

I got

test-pkcs7.c:36:23: fatal error: gpg-error.h: No such file or directory
compilation terminated.

I then tried a local inclusion of the library

#include "/home/user/Downloads/gmime-2.6.19/gmime/gmime.h"

But I got this error.

/home/user/Downloads/gmime-2.6.19/gmime/gmime.h:25: error: glib.h: No such file or directory

Has anyone encountered this before ?

Was it helpful?

Solution

When you try compiling your program, try this:

g++ -o myprogram myprogram.cpp `pkg-config --cflags --libs gmime-2.6`

The problem is that you need to tell the compiler which include paths to use (--cflags) and what library paths to use (--libs).

When compiling individual sources, you could do:

g++ -o file.o -c file.cpp `pkg-config --cflags gmime-2.6`

And then use pkg-config --libs gmime-2.6 for the final step.

OTHER TIPS

solved the problem so installed all that is possible in “libgmime” and

sudo apt-get install libgmime-2.6-dev
sudo apt-get install libgmime2.6-cil
sudo apt-get install libglib2.0-dev
sudo apt-get install libgmime2.6-cil-dev

-

root:~$ ./configure
...
root:~$ gcc-shared res/res_http_post.c -o res/res_http_post.so -fPIC `pkg-config -cflags –libs gmime-2.6`
root:~$ cp res/res_http_post.so /usr/lib/asterisk/modules/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top