On Wed 06 Oct 2004, Pankaj Kaushal wrote:
> OPENGL_gl_LIBRARY /usr/lib/libGL.so
> OPENGL_glu_LIBRARY /usr/lib/libGLU.so
Note that you will also need a window toolkit, such as GTK, for vgui
to be really useful. I'm sure Debian has GTK installed by
default. You may not have a package called GTKGLArea (if you have
GTK1) or GTKGLExt (if you have GTK2). You should get the appropriate
RPMs and install. Re-run CMake, and it should give you an option for
VGUI_GTK, which should be ON.
> options. The compile went fine, I have linked the /usr/include/vcl to
If you want to do that, you should also link /usr/include/vxl-core to
/opt/VXLWithDoc/vxl-1.1.0/core. The alternative is not to link at
all, and instead of
> I was able to compile my first program, "hello world!" ;) using
> $ g++ -I/usr/include/vcl hello.cpp
g++ -I/opt/VXLWithDoc/vxl-1.1.0/vcl hello.cpp
> But, when I try to compile a vgui example,
> $ g++ -I/usr/include/vcl -I . basic01_display_image.cxx
Just to be clear: the examples can also be built by just running
"make" in that directory, if you have the CMake option BUILD_EXAMPLES
set to ON. However, in general, to avoid errors like
> using,gtk1_display_image.cxx:7:23: vgui/vgui.h:No such file or directory
> gtk1_display_image.cxx:8:37: vgui/vgui_image_tableau.h:No such file
> or d
you need to
g++ -I/usr/include/vcl -I/usr/include/vxl-core basic01_display_image.cxx
with vxl-core symlinked as above.
> /tmp/cc0R7KRN.o(.text+0x48): In function `main':
> : undefined reference to `vgui::init(int&, char**)'
> /tmp/cc0R7KRN.o(.text+0x128): In function `main':
> : undefined reference to `vgui::run(vgui_tableau_sptr const&, int, int,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> I also tried using the -l option to add /usr/lib/vxl it didnt help
> either. Am I doing something wrong? what needs to be done?
You'll need to actually link in the vgui library, and all its
dependencies. Assuming vgui built, and that your build directory is
g++ -I/opt/VXLWithDoc/vxl-1.1.0/vcl \
basic01_display_image.cxx -lvgui -lvnl_algo -lnetlib -lvnl \
-lvil -ljpeg -ltiff -lpng -lz -lvgl -lvpl -lvul -lvcl -lGLU \
-lGL -lX11 -lXext
would come close. I may be missing some dependent libraries, though.
I would highly recommend that you use CMake to build your example and
link against VXL until you have a better understanding of the various
dependencies and linking issues. Read through Appendix B of the VXL book.
It's probably a good idea to read this book first, anyway.