GTK在Visual Studio中出现问题!帮助 [英] GTK having Problem in Visual Studio! Help

查看:144
本文介绍了GTK在Visual Studio中出现问题!帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的人
我是C ++和Visual Studio的新手.我设法以某种方式添加了GTK lib,并将其包含在附加包含目录"中!这是我添加的方式

Hi folks
I am new in C++ stuff and visual studio. Somehow I managed to add GTK lib and includes in Additional Include Directory! here is how i added

C:\gtk\include\atk-1.0;C:\gtk\include;C:\gtk\include\gdk-pixbuf-2.0;C:\gtk\include\pango-1.0;C:\gtk\include\cairo;C:\gtk\lib\gtk-2.0\include;C:\gtk\lib\glib-2.0\include;C:\gtk\include\glib-2.0;C:\gtk\include\gtk-2.0;%(AdditionalIncludeDirectories)



所有文件设置正确,链接没有错误.

但是当我编译代码时,我得到了这个错误
这是代码的图像
http://i.stack.imgur.com/EXI64.png [



all files set correctly and no error with linking.

But when I compiling code I got this errors
here is image of code
http://i.stack.imgur.com/EXI64.png[^]

This is unrecognized error for me any one know what''s the matter!
here is code (this is basic code i get from tutorial over internet)

 #include<gtk\gtk.h>

int main(int argc,char* argv[]){

    gtk_init(&argc,&argv);
    GtkWidget* window;
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(window,"delete-event",G_CALLBACK(gtk_main_quit),NULL);
    gtk_widget_show(window);
    gtk_main();
    return 0;
}



感谢帮助!和您的时间



thanks for help! and your time

推荐答案

您声明:所有文件设置正确,链接没有错误.
但是该图像(如Espen所指出的)清楚地显示了LNK2019错误,即错误带有链接而不是编译.重要的是要了解构建程序的不同阶段以及每个步骤都需要哪些外部组件.在您的情况下,我注意到您还没有解析WinMain(),这表明您正在尝试创建Windows程序,但是源代码是用于控制台应用程序的.您尚未说明正在使用哪个IDE,但是如果您使用的是Microsoft Visual Studio版本,则应查看可以自动生成的示例应用程序.我还建议您在完全了解如何将Windows应用程序组合在一起之前,不要使用GTK.互联网上有很多有用的教程,其中包括
http://www.winprog.org/tutorial/ [ ^ ]和http://www.functionx.com/win32/index.htm [ ^ ].
You state: all files set correctly and no error with linking.
And yet the image (as Espen points out) clearly shows LNK2019 errors, i.e. the error is with linking and not compiling. It is important to understand the different stages of building a program and which externals are required at each step. In your case I note that you also have an unresolved for WinMain() which suggests that you are trying to create a Windows program, but your source code is for a console application. You have not said which IDE you are using but if you have a version of Microsoft''s Visual Studio, you should take a look at the sample applications that can be generated automatically. I would also suggest that you forget about using GTK until you fully understand how to put a Windows application together. There are many useful tutorials available on the internet including the ones at http://www.winprog.org/tutorial/[^] and http://www.functionx.com/win32/index.htm[^].


这篇关于GTK在Visual Studio中出现问题!帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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