Visual Servoing Platform
version 3.4.0
|
In this tutorial you will learn how to use ViSP without using CMake.
There are two ways to integrate ViSP as a 3rd-party in a Makefile
:
pkg-config
over visp.pc
file that you may find in ViSP installation folder; typically in /usr/local/lib/pkgconfig
folder,visp-config
shell script file that you may find in ViSP build folder; typically in $VISP_WS/visp-build/bin
folder.$ pkg-config --cflags visp
$ pkg-config --libs visp
visp.pc
file used by pkg-config
is not found, you may set PKG_CONFIG_PATH
environment variable with the path to access to visp.pc
using a command similar to: $ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:<visp install tree>/lib/pkgconfig
To build a file named HelloWorld.cpp
, both command could be used in a Makefile
which content would be the following:
CXX = g++ VISP_CFLAGS = `pkg-config --cflags visp` VISP_LDFLAGS = `pkg-config --libs visp` HelloWorld: HelloWorld.cpp $(CXX) $(VISP_CFLAGS) -o HelloWorld HelloWorld.cpp $(VISP_LDFLAGS) clean: rm -f *~ HelloWorld
$ cd $VISP_WS/visp-build $ visp-config --cflags visp
$ visp-config --libs visp
To build a file named HelloWorld.cpp
, both command could be used in a Makefile
which content would be the following:
CXX = g++ VISP_BUILD_DIR = ${VISP_WS}/visp-build VISP_CFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --cflags` VISP_LDFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --libs HelloWorld: HelloWorld.cpp $(CXX) $(VISP_CFLAGS) -o HelloWorld HelloWorld.cpp $(VISP_LDFLAGS) clean: rm -f *~ HelloWorld
You are now ready to see the Tutorial: How to display an image in a window. There is also the Tutorial: How to extend ViSP creating a new contrib module that could be useful to understand how to introduce new developments in ViSP.