如何在Visual Studio c ++ for Linux平台上编写GTK应用程序? [英] How to write GTK applications in Visual Studio c++ for Linux platform?

查看:258
本文介绍了如何在Visual Studio c ++ for Linux平台上编写GTK应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中为Linux平台制作了c ++项目,并使用g++, gdb, gdbserverlibgtk-3-dev连接到linux虚拟机.但是我不能用gtk.h lib编译程序.我需要做什么才能使Visual Studio检测到gtk?

解决方案

此问题可能会为您提供更多信息.

而且,当您使用c ++时,您可能会喜欢 gtkmm ,它为GTK +提供了c ++绑定

I made c++ project for Linux platform in Visual Studio and connected to linux virtual machine with g++, gdb, gdbserver and libgtk-3-dev. But I can't compile program with gtk.h lib. What do I need to do for Visual Studio to detect gtk?

解决方案

Visual C++ for Linux builds your application on the target Linux system. Therefore the GTK+ headers and libraries need only be present on the Linux target. However, if you want IntelliSense to work (and who wouldn't) the GTK+ headers need to be visible to Visual Studio on the Windows host. The easiest way to do this is to copy the headers onto the Windows host (put them in their own folder). The include path in Visual Studio's project settings must specify the Linux path for the GTK+ headers for g++ on the Linux target and the Windows path on the Windows host.

This question might give you some more information.

And, as you are using c++, you might like gtkmm which provides c++ bindings for GTK+.

这篇关于如何在Visual Studio c ++ for Linux平台上编写GTK应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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