Install and configure gtkmm for vs in Windows 7

Source: Internet
Author: User

In order to use the GTK + Library in Vs, I took a detour this afternoon and added the GTK + Library to vs2010. Finally, vs2008 is selected, and the result is successful. Now I want to share with you how I added the GTK + Library to vs2008. Why do you want to use GTK + in.

So why do you choose gtkmm instead of GTK +? It should be known that gtkmm is an encapsulated class that supports C ++ and C.

Steps:

1. Download The gtkmm installation package first ,. Install gtkmm with one click );

2. Open vs2008 and create a console project. The project I created is gtk_test and saved in the folder: e: \ Vc ++ 2008 \ gtk_test.

For example:

3. After the project is created, open the property manager. Where can I find the property manager? Open Path:

4. go to the folder where gtkmm is installed. I installed it on drive c: \ gtkmm \ msvc. Go to the msvc folder and copy the following two files to the project directory: e: \ Vc ++ 2008 \ gtk_test.

5. Go to the property manager, right-click "Debug | Win32", and select "add existing property table"

Then select the assigned file "gtkmm-vc90-d-2_4 ". Right-click "Release | Win32", the same as above, but select the file "gtkmm-vc90-2_4 ".

6. All right, it's basically done. Now let's modify the stdafx. h file:

As follows:

Gtk_test.cpp // stdafx. h: Include files in the standard system, // or include files that are frequently used but not frequently changed // include files specific to the project // # pragma once # include "targetver. H "# include <stdio. h> # include <gtkmm. h> // todo: ReferenceProgramOther header files

Modify the gtk_test.cpp file as follows:

 
// Gtk_test.cpp: defines the entry point of the console application. // # Include "stdafx. H "int main (INT argc, char * argv []) {GTK: Main kit (argc, argv); GTK: Window window; GTK: Main :: run (window); Return exit_success ;}

5. If the compilation is ready, the debug version may jump out due to a bug in vs2008.

This problem is not explained here (the solution should be searched on Google ).

Execute the release version compilation, for example, but there is a console window behind the GTK window.

6. How can I remove the following console? We recommend that you retain this console window for debug. The method for removing the console is as follows:

Right-click "gtk_test" and choose attribute settings.

In the properties setting window, modify: linker-> system-> subsystem to Windows (/subsystem: Windows)

 

Modify: The linker-> advanced-> entry point is set to maincrtstartup.

We recommend that you modify only the release configuration.

7. The running result is as follows:

Click here for the use of the gtkmm Library

Click here if you want to learn GTK + programming

I'm a beginner. Here I just want to share what I know. Next, I will start to learn about GKT.

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.