How to write GTK applications in Visual Studio c++ for Linux platform?

若如初见. 提交于 2019-12-13 07:35:05

问题


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?


回答1:


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+.



来源:https://stackoverflow.com/questions/45122548/how-to-write-gtk-applications-in-visual-studio-c-for-linux-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!