将GTK + 3.24.21(Glade)库与代码块(C)集成 [英] Integrating GTK+3.24.21 (Glade) libs with Codeblocks (C)

查看:125
本文介绍了将GTK + 3.24.21(Glade)库与代码块(C)集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将GTK + 3.24.21(Glade)库与Codeblocks 17.12集成在一起,以编译GTK + C应用程序。我使用以下命令通过MSYS2 MSYS(来自官方网站)通过MSYS2 MSYS安装了mingw64编译器,Glade和GKT:pacman -S mingw-w64-x86_64-gtk3 pacman -S mingw-w64-x86_64-gtkmm3 pacman -S mingw -w64-x86_64-glade 。我试图通过 GTK +项目创建GTK项目,类别,它失败了,因为我无法指向GTK库的正确目录。我已经尝试过这个: C:\msys64\mingw64\include\gtk-3.0\gtk ,但失败的原因是没有 include夹。
我设法达到目标的唯一方法是选择mingw64作为编译器并创建控制台项目,然后更改构建选项。到以下内容:其他编译器选项- pkg-config gtk + -3.0 --cflags ,其他链接器选项- pkg-config gtk + -3.0 --libs 。因此,现在编译器可以获取库了。程序的编译和运行结果是其背后的UI窗口和控制台。因此,我正在寻找通过 GTK +项目创建项目的方法。类别,或者如果第一个类别无法将控制台窗口隐藏在主UI窗口后面。

I want to integrate GTK+3.24.21 (Glade) libs with Codeblocks 17.12 for compiling of GTK+ C apps. I installed mingw64 compiler, Glade, and GKT via MSYS2 MSYS (from official website) using these commands pacman -S mingw-w64-x86_64-gtk3 pacman -S mingw-w64-x86_64-gtkmm3 pacman -S mingw-w64-x86_64-glade. I've tried to create GTK project through "GTK+ project" category and it failed cos I just can't point to the right directory of GTK libs. I've tried this one: "C:\msys64\mingw64\include\gtk-3.0\gtk" ,but it failed cos there is no "include" folder. The only way I managed to reach the goal was to choose mingw64 as compiler and to create "Console project", change "Build options" to the following: other compiler options - pkg-config gtk+-3.0 --cflags, other linker options - pkg-config gtk+-3.0 --libs. So now compiler is able to get libs. The result of compilation and running of the program is UI window and console behind it. So I'm looking for the way to create project through "GTK+ project" category or if the first is impossible to conceal the console window behind the main UI window.

推荐答案

我发现它是使Codeblocks的向导查找GTK库非常复杂。因此,解决方案是创建空项目。在代码块中,并更改项目的这些设置(请参见图片)。

I've found out that it's quite complicated to make Codeblocks' wizard find GTK libs. So the solution is to create "Empty project" in Codeblocks and change these settings (look at the pic) of the project.

这篇关于将GTK + 3.24.21(Glade)库与代码块(C)集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆