Dear All,

 

      I'm new to VXL. I found I could compile and run the example 2.0.1. When I trun to try example 2.0.2, I got a "Undefined reference to vil_load" error. Could anyone help? I'm sure that I could find libvil.a under /usr/local/lib directory.

 

     SRC is :

 

 
#include <vcl_iostream.h>
#include <vxl_config.h>
#include <vil/vil_rgb.h>
#include <vil/vil_load.h>
#include <vil/vil_image_view.h>

int main()
{
  // Load image into memory.
  vil_image_view<vil_rgb<vxl_byte> > img = vil_load("foo.ppm");

  // Access pixel (100,100) and print its value as an int.
  vcl_cerr << "Pixel 100,100 = " << img(100,100) << vcl_endl;

  return 0;
}
Error message is:
# g++ test2.cpp 
/tmp/ccgjxr3C.o: In function `main':
test2.cpp:(.text+0x1a5): undefined reference to `vil_load(char const*, bool)'
test2.cpp:(.text+0x1ba): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::vil_image_view(vil_smart_ptr<vil_image_view_base> const&)'
test2.cpp:(.text+0x22d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& operator<< <unsigned char>(std::basic_ostream<char, std::char_traits<char> >&, vil_rgb<unsigned char> const&)'
/tmp/ccgjxr3C.o: In function `vil_smart_ptr<vil_image_view_base>::~vil_smart_ptr()':
test2.cpp:(.text._ZN13vil_smart_ptrI19vil_image_view_baseED1Ev[vil_smart_ptr<vil_image_view_base>::~vil_smart_ptr()]+0x24): undefined reference to `vil_smart_ptr<vil_image_view_base>::unref(vil_image_view_base*)'
/tmp/ccgjxr3C.o: In function `vil_smart_ptr<vil_memory_chunk>::~vil_smart_ptr()':
test2.cpp:(.text._ZN13vil_smart_ptrI16vil_memory_chunkED1Ev[vil_smart_ptr<vil_memory_chunk>::~vil_smart_ptr()]+0x24): undefined reference to `vil_smart_ptr<vil_memory_chunk>::unref(vil_memory_chunk*)'
/tmp/ccgjxr3C.o:(.rodata._ZTV14vil_image_viewI7vil_rgbIhEE[vtable for vil_image_view<vil_rgb<unsigned char> >]+0x10): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::set_size(unsigned int, unsigned int)'
/tmp/ccgjxr3C.o:(.rodata._ZTV14vil_image_viewI7vil_rgbIhEE[vtable for vil_image_view<vil_rgb<unsigned char> >]+0x14): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::set_size(unsigned int, unsigned int, unsigned int)'
/tmp/ccgjxr3C.o:(.rodata._ZTV14vil_image_viewI7vil_rgbIhEE[vtable for vil_image_view<vil_rgb<unsigned char> >]+0x18): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::print(std::basic_ostream<char, std::char_traits<char> >&) const'
/tmp/ccgjxr3C.o:(.rodata._ZTV14vil_image_viewI7vil_rgbIhEE[vtable for vil_image_view<vil_rgb<unsigned char> >]+0x1c): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::is_a() const'
/tmp/ccgjxr3C.o:(.rodata._ZTV14vil_image_viewI7vil_rgbIhEE[vtable for vil_image_view<vil_rgb<unsigned char> >]+0x24): undefined reference to `vil_image_view<vil_rgb<unsigned char> >::is_class(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
collect2: ld returned 1 exit status
 
Thanks & Best Regards.
Doris.



好玩贺卡等你发,邮箱贺卡全新上线!


好玩贺卡等你发,邮箱贺卡全新上线!