在Visual Studio 2012编译GTK3程序 [英] Compiling a GTK3 program in Visual Studio 2012
问题描述
用GTK 3的发布的Windows我还以为我的升级GTK 2 C应用程序采取新GtkGrid部件的优势。
With the release of Gtk 3 for windows I thought of upgrading my Gtk 2 C application to take advantage of the new GtkGrid widget.
该计划下编译Linux或Windows下使用MinGW的(与$ C $个cblocks)的罚款,但是当我尝试了同一组文件的Visual Studio 2012下,给了我50元左右编译错误说gutils.h,gtrashstack。 H和gstring.h有一大堆的语法错误(假设我只用一个基本的程序,只需gtk_init并进入主循环)的。
The program compiles fine under linux or using MinGW (with codeblocks) under windows, however when I try the same set of files under Visual Studio 2012, giving me 50 or so compilation errors saying gutils.h, gtrashstack.h and gstring.h have a bunch of syntax errors (assuming I only use a basic program, with just a gtk_init and gtk_main).
Visual Studio中的gtk2处理得非常好。为什么拒绝与gtk3编译?什么方法可以把它与它的工作?
像我爱code :: Blocks的,外部的力量迫使我保持我的code VS2012兼容...
Visual Studio handled gtk2 very well. Why is it refusing to compile with gtk3? Any way to get it to work with it? As much as I love Code::Blocks, external powers force me to keep my code VS2012-compatible...
编辑:我创建了一个资源库和一个简单的gtk3方案和VS2012 preconfigured项目文件和$ C $的cblock。
https://github.com/The-J-Person/Example-gtk3 -vs2012项目
I created a repository with a simple gtk3 program and preconfigured project files for VS2012 and Codeblocks. https://github.com/The-J-Person/Example-gtk3-vs2012-project
编辑2:这是由VS2012提供的编译错误的列表:
http://pastebin.com/ThZpwVmg
EDIT 2: Here's a list of the compilation errors given by VS2012: http://pastebin.com/ThZpwVmg
推荐答案
现在有GTK的邮件列表上的回答。
There is now an answer on the GTK mailing list.
在gutils.h线82和122,并在gstring.h线129,变静态内联到静态_ 内联。另外增加preprocessorDefinition到项目文件来定义内联为的_inline。
In gutils.h lines 82 and 122, and in gstring.h line 129, change "static inline" to "static _inline". Alternatively add a PreprocessorDefinition to the project file to define "inline" as "_inline".
https://mail.gnome.org/archives/ GTK列表/ 2014年一月/ msg00011.html
这让我的项目工作就好了。
That allowed my project to work just fine.
这篇关于在Visual Studio 2012编译GTK3程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!