libetpan and gcc

"Nicolas GHAZARIAN" <[email protected]> Sun, 11 Jan 2009 18:38:08 +0100
Newsgroups gmane.mail.libetpan.user
Message-ID <000001c97413$5e3f57e0$1abe07a0$@fr>
Il s'agit d'un message à parties multiples au format MIME.

--===============7549926974723444363==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0001_01C9741B.C003BFE0"
Content-Language: fr

Il s'agit d'un message à parties multiples au format MIME.

------=_NextPart_000_0001_01C9741B.C003BFE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

=20

I=92ve installed libetpan on Ubuntu with your instructions and I tried =
to
compile one of your example, but gcc don=92t compile.

=20

Here the logs:

gcc test.c

/tmp/ccYP1KPo.o: In function `main':

test.c:(.text+0x3d): undefined reference to `mailimf_mailbox_new'

test.c:(.text+0x4b): undefined reference to `mailimf_mailbox_free'

collect2: ld a retourn=C3=A9 1 code d'=C3=A9tat d'ex=C3=A9cution

-------------------------------------------------------------------------=
---
-------------------------------------------------

-------------------------------------------------------------------------=
---
-------------------------------------------------

Code :

#include <libetpan/libetpan.h>

#include <string.h>

=20

int main(int argc, char ** argv)

{

  struct mailimf_mailbox * mb;

  char* display_name;

  char* address;

=20

  display_name =3D strdup("DINH =3D?iso-8859-1?Q?Vi=3DEAt_Ho=3DE0?=3D");

  address =3D strdup("[email protected]");

  mb =3D mailimf_mailbox_new(display_name, address);

  /* do the things */

  mailimf_mailbox_free(mb);

=20

  return 0;

}

=20

/* display mailbox information */

=20

#include <libetpan/libetpan.h>

#include <stdio.h>

=20

void display_mailbox(struct mailimf_mailbox * mb)

{

  if (mb->mb_display_name !=3D NULL)

    printf("display name: %s\n", mb->mb_display_name);

  printf("address specifier : %s\n", mb->mb_addr_spec);

}

-------------------------------------------------------------------------=
---
-------------------------------------------------

-------------------------------------------------------------------------=
---
-------------------------------------------------

=20

I think the problem is that i don=92t know how use gcc with libetpan. =
Can you
explain me how to compile this code please ?

=20

In fine, is it a good library for create a mail server ?

=20

Best regards,

=20

Nicolas GHAZARIAN

IT Student


------=_NextPart_000_0001_01C9741B.C003BFE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>

<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DFR link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span lang=3DEN-US>Hi,<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I&#8217;ve installed libetpan on =
Ubuntu
with your instructions and I tried to compile one of your example, but =
gcc don&#8217;t
compile.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Here the =
logs:<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>gcc test.c<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>/tmp/ccYP1KPo.o: In function =
`main':<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>test.c:(.text+0x3d): undefined =
reference to
`mailimf_mailbox_new'<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>test.c:(.text+0x4b): undefined =
reference to
`mailimf_mailbox_free'<o:p></o:p></span></p>

<p class=3DMsoNormal>collect2: ld a retourn&Atilde;&copy; 1 code
d'&Atilde;&copy;tat d'ex&Atilde;&copy;cution<o:p></o:p></p>

<p =
class=3DMsoNormal>-------------------------------------------------------=
----------------------------------------------------------------------<o:=
p></o:p></p>

<p =
class=3DMsoNormal>-------------------------------------------------------=
----------------------------------------------------------------------<o:=
p></o:p></p>

<p class=3DMsoNormal><span =
lang=3DEN-US>Code&nbsp;:<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>#include =
&lt;libetpan/libetpan.h&gt;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>#include =
&lt;string.h&gt;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>int main(int argc, char ** =
argv)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>{<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; struct mailimf_mailbox * =
mb;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; char* =
display_name;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; char* =
address;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; display_name =3D =
strdup(&quot;DINH
=3D?iso-8859-1?Q?Vi=3DEAt_Ho=3DE0?=3D&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; address =3D
strdup(&quot;[email protected]&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; mb =3D
mailimf_mailbox_new(display_name, address);<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; /* do the things =
*/<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; =
mailimf_mailbox_free(mb);<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; return =
0;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>}<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>/* display mailbox information =
*/<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>#include =
&lt;libetpan/libetpan.h&gt;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>#include =
&lt;stdio.h&gt;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>void display_mailbox(struct =
mailimf_mailbox
* mb)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>{<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; if =
(mb-&gt;mb_display_name !=3D NULL)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp;&nbsp;&nbsp; =
printf(&quot;display
name: %s\n&quot;, mb-&gt;mb_display_name);<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>&nbsp; printf(&quot;address =
specifier :
%s\n&quot;, mb-&gt;mb_addr_spec);<o:p></o:p></span></p>

<p class=3DMsoNormal>}<o:p></o:p></p>

<p =
class=3DMsoNormal>-------------------------------------------------------=
----------------------------------------------------------------------<o:=
p></o:p></p>

<p =
class=3DMsoNormal>-------------------------------------------------------=
----------------------------------------------------------------------<o:=
p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><span lang=3DEN-US>I think the problem is that i =
don&#8217;t
know how use gcc with libetpan. Can you explain me how to compile this =
code
please ?<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>In fine, is it a good library =
for create a
mail server ?<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Best =
regards,<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Nicolas =
GHAZARIAN<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>IT Student<o:p></o:p></span></p>

</div>

</body>

</html>

------=_NextPart_000_0001_01C9741B.C003BFE0--



--===============7549926974723444363==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
--===============7549926974723444363==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Libetpan-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libetpan-users

--===============7549926974723444363==--