在linux下用eclipse开发c++程序时出错,找不到include文件

bbhl80 2006-02-15 07:47:59
我用的是Red Hat Fedroa Core3+gtkmm+eclipse+CDT,装好了以后建立Managed C++ Project,文件如下
helloworld.h:
#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
#define GTKMM_EXAMPLE_HELLOWORLD_H

#include <gtkmm/button.h>
#include <gtkmm/window.h>

class HelloWorld : public Gtk::Window
{

public:
HelloWorld();
virtual ~HelloWorld();

protected:
//Signal handlers:
virtual void on_button_clicked();

//Member widgets:
Gtk::Button m_button;
};

#endif // GTKMM_EXAMPLE_HELLOWORLD_H

helloworld.cxx:
#include "helloworld.h"
#include <iostream>

HelloWorld::HelloWorld()
: m_button("Hello World") // creates a new button with the label "Hello World".
{
// Sets the border width of the window.
set_border_width(10);

// When the button receives the "clicked" signal, it will call the
// on_button_clicked() method. The on_button_clicked() method is defined below.
m_button.signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked));

// This packs the button into the Window (a container).
add(m_button);

// The final step is to display this newly created widget...
m_button.show();
}

HelloWorld::~HelloWorld()
{
}

void HelloWorld::on_button_clicked()
{
std::cout << "Hello World" << std::endl;
}

main.cxx:
#include <gtkmm/main.h>
#include "helloworld.h"

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

HelloWorld helloworld;
Gtk::Main::run(helloworld); //Shows the window and returns when it is closed.

return 0;
}

编译的时候说找不到头文件gtkmm/main.h,gtkmm/button.h,gtkmm/window.h,但是可以找到<iostream>,这是为什么?
...全文
342 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wshcdr 2006-02-16
  • 打赏
  • 举报
回复
会不会是没有安装GTK的SDK 包?
积木 2006-02-16
  • 打赏
  • 举报
回复
第一,可能没有安装sdk
第二,你的编译器没有指定include的编译参数。

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧