MinGW compiling Virt-viewer

Source: Internet
Author: User
Tags cairo gtk microsoft c

Http://www.spice-space.org/download.html can be downloaded to the Windows version of the Virt viewer

Virt-viewer-x86-0.5.7.msi and Virt-viewer-x64-0.5.7.msi are compiled using MinGW, the source code is the use of virt-viewer-0.5.7.tar.gz

If you need to customize the Virt viewer, you need to compile the executable binary code from the source code, this article describes the process of compiling the Windows Edition Virt Viewer.

MinGW

Before compiling the Virt viewer with MinGW, let's briefly introduce MinGW. Given that MinGW is too big, we can only donuts.

MinGW is a minimalist GUN for Windows abbreviation. MinGW provides a set of development environments for developing Microsoft Windows native Apps.

MinGW provides a set of fully open source programming tools that you can use to develop Windows native apps without relying on third-party C-run DLLs. Of course MinGW still relies on several operating system DLLs provided by Microsoft, such as MSVCRT.DLL.

The MinGW compiler provides access to Microsoft C Runtime and some language-specific runtimes. MinGW's minimalist, which is reflected here, MinGW did not attempt to provide a POSIX runtime environment.

[HTML]View Plaincopy
    1. <span style="font-size:10px;" >microsoft C Runtime
    2. C Runtime is a concept of the Windows platform, in general CRT functions (c runtime functions) are standard C language functions. For example, printf, scanf, strlen, fopen, and so on are functions that belong to CRT functions.
    3. But all CRT functions under windows are eventually translated into the Win32 API for execution. The Windows kernel itself, and does not provide support for the CRT.
    4. </span>

Since MinGW is based on GNU, Nature can provide a set of cross-compilation environments in Linux. With MinGW, we can develop, compile, and run Windows applications under Linux.

The Virt-viewer-x86-0.5.7.msi and Virt-viewer-x64-0.5.7.msi mentioned above are the product of the MINGW compilation environment.

After installing them, you can go to the installation directory to see the directory structure on my machine as follows.

For Linux developers, this directory hierarchy is not familiar.

That's right! The installation directory contains executable files, configuration scripts, and various GNU libraries (of course, these are Windows DLLs, not Linux. So)

Since the Virt Viewer uses a large number of GNU libraries, it is necessary to re-compile the Virt viewer with the help of MinGW.

Preparing the development environment

MINGW Development environment

Build MINGW development environment on windows, refer to Http://www.mingw.org/wiki/InstallationHOWTOforMinGW, MINGW development environment under Windows is officially supported

Here we only describe the construction of Linux under the MinGW development environment. Note that because the Linux MinGW cross-compilation environment is provided by distributors, these cross-tool chains are not mingw.org provided directly.

The MinGW development package is available on the Linux distribution fedora, so we chose Fedora 19 as the software environment.

Fedora MinGW has a considerable number of packages, we choose to install all here, a total of 700MB, fortunately, today fast speed.

[CPP]View Plaincopy
    1. # su
    2. # yum Install mingw*
    3. # yum Install Intltool
    4. # yum Install icoutils.i686

Compiling Virt Viewer

1. Download Virt-viewer Source code

There are many virt_viewer versions in https://fedorahosted.org/released/virt-viewer/, here we use virt-viewer-0.5.6.tar.gz

2. Unzip

[HTML]View Plaincopy
    1. # tar ZXVF virt-viewer-0.5.76.tar.gz
    2. # CD virt-viewer-0.5.6

3. First execute the MinGW configure tool

[HTML]View Plaincopy
    1. # mingw32-configure --with-gtk=2.0--with-spice-gtk

Since we have installed the vast majority of libraries in the MINGW environment above, we generally do not fail here, and if you fail, follow the prompts to install with Yum.

Shown below on my machine

[HTML]View Plaincopy
  1. Configure:configuration Summary
  2. Configure: =====================
  3. Configure
  4. Configure:features:
  5. Configure
  6. configure:gtk:2.0
  7. Configure
  8. Configure:libraries:
  9. Configure
  10. CONFIGURE:GLIB2:-mms-bitfields-i/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0-i/usr/i686-w64-mingw32/s ys-root/mingw/lib/glib-2.0/include-l/usr/i686-w64-mingw32/sys-root/mingw/lib-lgthread-2.0-lgmodule-2.0- Lglib-2.0-lintl
  11. Configure
  12. configure:          gtk: -mms-bitfields -i/usr/ i686-w64-mingw32/sys-root/mingw/include/gtk-2.0 -i/usr/i686-w64-mingw32/sys-root/mingw/lib/gtk-2.0/ include -i/usr/i686-w64-mingw32/sys-root/mingw/include/atk-1.0 -i/usr/i686-w64-mingw32/sys-root/ mingw/include/cairo -i/usr/i686-w64-mingw32/sys-root/mingw/include/gdk-pixbuf-2.0 -i/usr/ i686-w64-mingw32/sys-root/mingw/include/pango-1.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0  -i/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -i/usr/i686-w64-mingw32/sys-root/mingw/ include/pixman-1 -i/usr/i686-w64-mingw32/sys-root/mingw/include -i/usr/i686-w64-mingw32/sys-root/ mingw/include/freetype2 -i/usr/i686-w64-mingw32/sys-root/mingw/include/libpng15 -i/usr/ i686-w64-mingw32/sys-root/mingw/include/harfbuzz   -wl,-luuid -l/usr/i686-w64-mingw32/ Sys-root/mingw/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lgdk _pixbuf-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lfontconfig - lpango-1.0 -lm -lcairo -lgobject-2.0 -lglib-2.0 -lintl    
  13. CONFIGURE:&NBSP;&NBSP;&NBSP;
  14. configure:      gtk_vnc: -mms-bitfields -i/usr/i686-w64-mingw32/ sys-root/mingw/include/gtk-vnc-1.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/gvnc-1.0 -i/usr/ i686-w64-mingw32/sys-root/mingw/include/gtk-2.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0  -i/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -i/usr/i686-w64-mingw32/sys-root/mingw/ lib/gtk-2.0/include -i/usr/i686-w64-mingw32/sys-root/mingw/include/atk-1.0 -i/usr/i686-w64-mingw32/ sys-root/mingw/include/cairo -i/usr/i686-w64-mingw32/sys-root/mingw/include/gdk-pixbuf-2.0 -i/usr/ I686-w64-mingw32/sys-root/mingw/include/pango-1.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/pixman-1  -i/usr/i686-w64-mingw32/sys-root/mingw/include -i/usr/i686-w64-mingw32/sys-root/mingw/include/ freetype2 -i/usr/i686-w64-mingw32/sys-root/mingw/include/libpng15 -i/usr/i686-w64-mingw32/sys-root/ mingw/include/harfbuzz   -wl,-luuid -l/usr/i686-w64-mingw32/sys-root/mingw/lib -lgtk-vnc-1.0 -lgvnc-1.0  -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 - Lpangocairo-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32  -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lglib-2.0  -lintl    
  15. CONFIGURE:&NBSP;&NBSP;&NBSP;
  16. configure:    spice_gtk: -mms-bitfields -i/usr/i686-w64-mingw32/sys-root/mingw/ include/spice-client-gtk-2.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/gtk-2.0 -i/usr/ i686-w64-mingw32/sys-root/mingw/include/spice-client-glib-2.0 -i/usr/i686-w64-mingw32/sys-root/mingw/lib/ gtk-2.0/include -i/usr/i686-w64-mingw32/sys-root/mingw/include/atk-1.0 -i/usr/i686-w64-mingw32/ sys-root/mingw/include/cairo -i/usr/i686-w64-mingw32/sys-root/mingw/include/gdk-pixbuf-2.0 -i/usr/ i686-w64-mingw32/sys-root/mingw/include/pango-1.0 -i/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0  -i/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -i/usr/i686-w64-mingw32/sys-root/mingw/ include/pixman-1 -i/usr/i686-w64-mingw32/sys-root/mingw/include -i/usr/i686-w64-mingw32/sys-root/ mingw/include/freetype2 -i/usr/i686-w64-mingw32/sys-root/mingw/include/libpng15 -i/usr/ I686-w64-mingw32/sys-root/mingw/include/harfbuzz -i/usr/i686-w64-mingw32/sys-root/mingw/include/spice-1   -wl,-luuid -l/usr/ i686-w64-mingw32/sys-root/mingw/lib -lspice-client-gtk-2.0 -lgtk-win32-2.0 - lspice-client-glib-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 - Lpangocairo-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32  -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lglib-2.0  -lintl    
  17. Configure
  18. CONFIGURE:LIBXML2:-i/usr/i686-w64-mingw32/sys-root/mingw/include/libxml2-l/usr/i686-w64-mingw32/sys-root/mingw /lib-lxml2
  19. Configure
  20. Configure:libvirt:-i/usr/i686-w64-mingw32/sys-root/mingw/include-l/usr/i686-w64-mingw32/sys-root/mingw/lib-lvi Rt-lportablexdr-lintl
  21. Configure
  22. Configure:ovirt:
  23. Configure

Compile

[HTML]View Plaincopy
    1. Mingw32-make

The compilation process may also be dependent on the tool error, download the required toolkit to solve

Installation

[HTML]View Plaincopy
    1. Mingw32-make Install

After executing the installation command, the compiled generated files are copied to/usr/i686-w64-mingw32/sys-root/mingw, and the execution of the files depends on the bin, etc, Conf, Lib and share in this directory, We need to copy the contents of these directories to Windows.

These directories are the basic operating environment for MINGW Windows applications, most of which are not virt-viewer necessary, and we will list the files that are required to run virt-viewer.

Perform

[HTML]View Plaincopy
    1. CD MinGW
    2. CD bin
    3. Remote-viewer.exe

You can see the GTK-style remote viewer.

MinGW compiling Virt-viewer

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.