Eclipse CDT的&安培; gtkmm的:" ...无法解析"但是编译和运行。 [英] Eclipse CDT & gtkmm: "... could not be resolved.", but compiles and runs

查看:129
本文介绍了Eclipse CDT的&安培; gtkmm的:" ...无法解析"但是编译和运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编码Eclipse CDT的C ++中的gtkmm用。我已成功地设置Eclipse所以c正确编译$ C $,加入 pkg配置gtkmm的3.0 --cflags --libs 编译器选项。所以它运行,和作品。但在编辑器相关的一切GTK强调用红色,当我将鼠标悬停在那些部分,它说是这样的:键入'的Gtk ::主要无法解析。所以,我可以code这样的,但它确实带有自动完成不工作,红色线条都在屏幕上一痛。我怎样才能解决这个问题?

I'm coding in Eclipse CDT in C++ with gtkmm. I have managed to set up Eclipse so it compiles the code correctly, by adding pkg-config gtkmm-3.0 --cflags --libs to the compiler options. So it runs, and works. But in the editor is everything gtk related underlined with red and when I hover over those parts, it says something like: Type 'Gtk::Main' could not be resolved. So I could code like this, but it's really a pain with autocompletion not working and red lines all over the screen. How can I solve this?

我的code看起来是这样的:

My code looks something like this:

#include <gtkmm-3.0/gtkmm.h>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    Gtk::Main kit(true);

    Gtk::Box* box = new Gtk::Box();

    ...

不过,我不认为这是关系到code。因为它在code ::块,用code完成,所有的罚款。但我preFER Eclipse中对C :: B点。

However, I don't think it's related to the code. Because it works fine in Code::Blocks, with code completion and all. But I prefer Eclipse over C::B.

//丹尼尔

推荐答案

选择项目 - > 属性从菜单中打开属性窗口即可。然后在左侧选择,请转到 C / C ++常规 - > 路径和符号。你会看到包含目录列表。看看输出 pkg配置--cflags的gtkmm-3.0 ,并确保所有的目录提到,也有在此列表中。

Select Project -> Properties from the menu to open the properties window. Then in the selector on the left, go to C/C++ general -> Paths and symbols. You will see a list of Include directories. Look at the output of pkg-config --cflags gtkmm-3.0 and make sure all the directories mentioned there are also in this list.

请注意,这些都是在Eclipse的语法检查器寻找包括文件的路径。您code编译好,因为编译器是找到这些文件的方式应该。

Note that these are the paths in which Eclipse's syntax checker looks for include files. Your code compiles fine, because the compiler is finding these files the way it should.

这篇关于Eclipse CDT的&安培; gtkmm的:&QUOT; ...无法解析&QUOT;但是编译和运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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