Compile vmime on windows with msvc9

Source: Internet
Author: User
Tags vc9

Vmime is an open-source third-party class library under GNU, mainly supporting various mail protocols.
 

I am unable to speak about the various third-party library compilation in C ++ in windows.

Libvmime-0.9.1.tar.bz
Http://www.vmime.org/downloads.html

Libiconv-1.9.1
 

Http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz

Gettext-0.13.1.tar.gz
 

Http://ftp.gnu.org/pub/gnu/gettext/gettext-0.13.1.tar.gz

Libgsasl-1.4.4.tar.gz
Ftp://ftp.gnu.org/gnu/gsasl/

Gnutls-2.10.1-x86.exe)
Ftp://ftp.gnu.org/gnu/gnutls/

(1). libiconv gettext dependency Compilation
 
The iconv () function is used for vmime, while the libiconv and gettext libraries are mutually dependent and compiled, which is a little troublesome.

1. Create an USR folder under the C-root directory and decompress libvmime-0.9.1.tar.bzand gettext-0.13.1.tar.gz to this folder.

2. compile and install an iconv that does not support internationalization
open Visual Studio 2008 of vc9
command prompt. First, enter the following command in the libvime directory
nmake-F makefile. msvc
no_nls = 1 DLL = 1 mflags =-MD (note that the mflags parameter must be consistent with the runtime
library of your project);
after OK, run the following command:
nmake-F makefile. msvc
no_nls = 1 DLL = 1 mflags =-MD install
and so on, then enter the following command
nmake-F
makefile. msvc no_nls = 1 DLL = 1 mflags =-MD distclean
3. compile and install gettext
open Visual Studio 2008 of vc9
command prompt, go to the gettext directory, and enter the following command
nmake-F makefile. msvc DLL = 1
mflags =-MD
and so on, enter the following command
nmake-F makefile. msvc DLL = 1
mflags =-MD install
4. compile and install iconv that supports internationalization
open Visual Studio 2008 of vc9
command prompt and go to the libvime directory, enter the following command
nmake-F
makefile. msvc DLL = 1 mflags =-MD
and so on, enter the following command
nmake-F makefile. msvc DLL = 1
mflags =-MD install


The reason for this is that these libraries are mutually dependent, so the compilation order is libiconv-> gettext-> libiconv


Be sure to compile in C:/usr; otherwise, an error may occur. (The Library in Linux is disgusting ...)
If you still don't understand it, take a look at readme. msvc under libvmime. Hope to help...

(2) libsasl Compilation

Libsasl library compilation is relatively simple. There are SLN project files in it, and you can open the build directly, but 1.6 does not seem to be compiled, and 1.4 does.

(3) gnutls compilation
the compilation of gnutls is amazing, download an EXE to install the Program . After the installation is complete, use Visual Studio 2008 command of vc9
prompt to enter its installation directory ( C: \ Program
files \ gnutls \ bin ), run the following command:
lib
/DEF: libgnutls-26.def
this will create a
libgnutls-26.lib that can be used as a import library for visual
studio projects.
build a sample program to test
it as follows:
C: \ Program
files \ gnutls \ bin> Cl Foo. c-I .. /include
-dssize_t = long libgnutls-26.lib... c: \ Program
files \ gnutls \ bin> Foo 1.6.0 C: \ Program
files \ gnutls \ bin>
reference: http://josefsson.org/gnutls4win/
using the gnutls DLL from your Visual Studio
Program column

(4) vmime Compilation

Put the header files under the previously compiled include files in the directory of vc9 (.. /VC/include), put the Lib files in the directory of vc9 (.. /VC/LIB) directory, and then open the SLN project file provided in vmime, build, successful!


If a vmime compilation error occurs, such as ssize_t undefined, you can remove the SRC file under the vmime directory and rebuild it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.