gtk的简单例子( windows环境下)
测试前用everything搜了搜,发现机器上已经有了gtk+-bundle_2.22.1-20101229_win64,完全忘了什么时候安装的了;
先阅读一下安装目录下的gtk+-bundle_2.22.1-20101229_win64.README.txt,将bin目录添加环境变量;
然后从参考的第一个链接去一个例子代码;
例子里是linux环境:
windows环境下:
运行pkg-config --cflags gtk+-2.0,回显的-mms-bitfields之后的即需要增加的include目录,
运行pkg-config --libs gtk+-2.0,回显即需要增加的链接目录,但是msvc下使用需要改变一下风格,即-L=>/link /LIBPATH:,-l去掉并加上.lib后缀;
然后进去vs 本机命令提示窗口,进入例程源码目录
cl xxx.cpp 加上上面的那些选项后即可生成例子的可执行程序。
测试运行效果:
参考:
[How to create GUI in C programming using GTK Toolkit](https://www.geeksforgeeks.org/how-to-create-gui-in-c-programming-using-gtk-toolkit/)
[how to compile gtk+ application for native windows](https://stackoverflow.com/questions/18799904/how-to-compile-gtk-application-for-native-windows-and-not-for-x-windows)
[Custom widget in GTK#](http://zetcode.com/gui/gtksharp/customwidget/)
[Creating a C/C++ GUI with GTK+](https://www.codeguru.com/cpp/cpp/creating-a-cc-gui-with-gtk.html)
[MFC、WTL、WPF、wxWidgets、Qt、GTK 各有什么特点?](https://www.zhihu.com/question/23480014)
[Tutorials for GTK+3 and GTK+4](https://medium.com/@ryanpatiency/my-experience-of-learning-gtk-3-4b07dc78c7c1)
[GTK入门学习:glade的使用](https://blog.csdn.net/dodod2012/article/details/81456707)
[GTK+:GTK+的简介、安装、使用方法之详细攻略](https://blog.csdn.net/qq_41185868/article/details/90238729)
[Flutter vs Qt QML](https://medium.com/@petar.koretic/flutter-vs-qt-qml-9a2d655b5ab1)
[Why you should use Qt/QML for your next cross-platform application — part 1 — desktop](https://medium.com/@petar.koretic/why-you-should-use-qt-qml-for-you-next-cross-platform-application-part-1-desktop-5e6d8856b7b4)
[how to ignore certificate error on qml WebEngineView](https://stackoverflow.com/questions/55194575/how-to-ignore-certificate-error-on-qml-webengineview)
[libGDIPlus](https://github.com/GCrean/libGDIPlus)
[TGdi](https://github.com/bzmework/TGdi)
[GDI-plus](https://www.codeproject.com/KB/GDI-plus/)
- 点赞
- 收藏
- 关注作者
评论(0)