Chinaunix首页 | 论坛 | 博客
  • 博客访问: 732336
  • 博文数量: 741
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-18 11:18
文章分类

全部博文(741)

文章存档

2011年(1)

2008年(740)

我的朋友

分类:

2008-09-18 11:25:04

我现在 下载了fltk的1.17在redhat9中进行了安装,但是在启动fluid生成界面后却不知道该如何去编译,因为按照帮助文档里提供的hello.cxx 利用gcc  -o myhello myhello.cxx`fltk-config  --cxxflag` -l/usr/local/lib -X11 -Xext  -lm进行编译,但是却出错有很多错误,首先是X11找不到,随后是不存在Xext ,
我的源代码hello.cxx
#include
#include
#include

int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(300,180);
  Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
  box->box(FL_UP_BOX);
  box->labelsize(36);
  box->labelfont(FL_BOLD+FL_ITALIC);
  box->labeltype(FL_SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return Fl::run();
}
我当时用的命令是
gcc `fltk-config --cxxflags` -o myhello hello.cxx  -L/usr/local/lib -I/usr/local/include/FL -lfltk -L/usr/X11R6/lib -lXext -lX11 -lm
编译时出的错误
/tmp/ccOKGP6s.o(.text+0x26): In function `main':
hello.cxx: undefined reference to `operator new(unsigned int)'
/tmp/ccOKGP6s.o(.text+0x53):hello.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0xff): In function `Fl::repeat_timeout(double, void (*)(void*), void*)':
Fl.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0x1fa): In function `Fl::add_check(void (*)(void*), void*)':
Fl.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0x468):Fl.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0x359): In function `Fl::remove_handler(int (*)(int))':
Fl.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0x13c6): In function `Fl_Window::hide()':
Fl.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl.o)(.text+0x13f5): In function `Fl_Window::~Fl_Window()':
Fl.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Box.o)(.gnu.linkonce.r._ZTI6Fl_Box[typeinfo for Fl_Box]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libfltk.a(Fl_Box.o)(.gnu.linkonce.t._ZN6Fl_BoxD0Ev[Fl_Box::~Fl_Box()]+0x1c): In function `Fl_Box::~Fl_Box()':
Fl_Box.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Group.o)(.text+0x4c): In function `Fl_Group::init_sizes()':
Fl_Group.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Group.o)(.text+0x6f0): In function `Fl_Group::sizes()':
Fl_Group.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Group.o)(.text+0x2a3): In function `Fl_Group::~Fl_Group()':
Fl_Group.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Group.o)(.gnu.linkonce.r._ZTI8Fl_Group[typeinfo for Fl_Group]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libfltk.a(Fl_arg.o)(.text+0x652): In function `Fl_Window::show(int, char**)':
Fl_arg.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_arg.o)(.text+0x69f):Fl_arg.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_get_system_colors.o)(.text+0x410): In function `Fl::reload_scheme()':
Fl_get_system_colors.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl_x.o)(.text+0x725): In function `Fl::copy(char const*, int, int)':
Fl_x.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_x.o)(.text+0x72f):Fl_x.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_x.o)(.text+0x8d3): In function `Fl_X::set_xid(Fl_Window*, unsigned long)':
Fl_x.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl_x.o)(.text+0x1150): In function `fl_handle(_XEvent const&)':
Fl_x.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_x.o)(.text+0x115e):Fl_x.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(fl_color.o)(.text+0x3ee): In function `fl_xpixel(Fl_Color)':
fl_color.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(fl_font.o)(.text+0x267): In function `fl_font(int, int)':
fl_font.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(fl_font.o)(.text+0x47c):fl_font.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl_Image.o)(.text+0xa1): In function `Fl_RGB_Image::~Fl_RGB_Image()':
Fl_Image.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Image.o)(.text+0x2ee): In function `Fl_RGB_Image::desaturate()':
Fl_Image.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Image.o)(.text+0x36f):Fl_Image.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Image.o)(.text+0x61c): In function `Fl_RGB_Image::copy(int, int)':
/usr/local/lib/libfltk.a(Fl_Menu_Window.o)(.text+0x47): In function `Fl_Menu_Window::~Fl_Menu_Window()':
Fl_Menu_Window.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Menu_Window.o)(.gnu.linkonce.r._ZTI14Fl_Menu_Window[typeinfo for Fl_Menu_Window]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x91): In function `Fl_Pixmap::delete_data()':
Fl_Pixmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x2e6): In function `Fl_Pixmap::draw(int, int, int, int, int, int)':
Fl_Pixmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x42b): In function `Fl_Pixmap::copy_data()':
Fl_Pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x448):Fl_Pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x711): In function `Fl_Pixmap::desaturate()':
Fl_Pixmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0x730):Fl_Pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0xa5a): In function `Fl_Pixmap::color_average(Fl_Color, float)':
Fl_Pixmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0xa7d):Fl_Pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0xad): In function `Fl_Pixmap::delete_data()':
Fl_Pixmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.text+0xe2): In function `Fl_Pixmap::~Fl_Pixmap()':
Fl_Pixmap.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Pixmap.o)(.gnu.linkonce.r._ZTI9Fl_Pixmap[typeinfo for Fl_Pixmap]+0x0): /usr/local/lib/libfltk.a(Fl_Tiled_Image.o)(.text+0xfc): In function `Fl_Tiled_Image::copy(int, int)':
/usr/local/lib/libfltk.a(fl_draw_image.o)(.text+0xded):fl_draw_image.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(fl_draw_pixmap.o)(.text+0x21b): In function `fl_draw_pixmap(char const* const*, int, int, Fl_Color)':
fl_draw_pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(fl_draw_pixmap.o)(.text+0x377):fl_draw_pixmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(fl_draw_pixmap.o)(.text+0x54e):fl_draw_pixmap.cxx: undefined reference to `operator delete[](void*)'/usr/local/lib/libfltk.a(Fl_Bitmap.o)(.text+0x60): In function `fl_create_alphamask(int, int, int, int, unsigned char const*)':
Fl_Bitmap.cxx: undefined reference to `operator new[](unsigned int)'
/usr/local/lib/libfltk.a(Fl_Bitmap.o)(.text+0x103):Fl_Bitmap.cxx: undefined reference to `operator delete[](void*)'
/usr/local/lib/libfltk.a(Fl_Bitmap.o)(.text+0x3d7):Fl_Bitmap.cxx: undefined reference to `operator new(unsigned int)'
/usr/local/lib/libfltk.a(Fl_Bitmap.o)(.text+0x1d3): In function `Fl_Bitmap::~Fl_Bitmap()':
Fl_Bitmap.cxx: undefined reference to `operator delete(void*)'
/usr/local/lib/libfltk.a(Fl_Bitmap.o)(.gnu.linkonce.r._ZTI9Fl_Bitmap[typeinfo for Fl_Bitmap]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libfltk.a(Fl_Button.o)(.gnu.linkonce.t._ZN9Fl_ButtonD0Ev[Fl_Button::~Fl_Button()]+0x1c): In function `Fl_Button::~Fl_Button()':
Fl_Button.cxx: undefined reference to `operator delete(void*)'
collect2: ld returned 1 exit status






这个错误长了些所以只把最重要的传了上来。还请多多指点。

请各位高手指点一二,不胜感激!多谢!      
--------------------next---------------------

阅读(456) | 评论(0) | 转发(0) |
0

上一篇:2007-10-18 22:34

下一篇:欢迎阅读我的文章

给主人留下些什么吧!~~