Non-templated functions implemented in header files need to be inlined
When including <bob.io.image/image.h>
in two C++ files, and linking these together, I obtain the linker error:
file_a.o: In function `X':
file_a.cpp:(.text+0x7d0): multiple definition of `bob::io::image::write_color_image(blitz::Array<unsigned char, 3> const&, std::string const&, std::string)'
file_b.cpp:(.text+0x880): first defined here
file_a.cpp.o: In function `X':
file_a.cpp:(.text+0xc40): multiple definition of `bob::io::image::write_gray_image(blitz::Array<unsigned char, 2> const&, std::string const&, std::string)'
file_b.cpp.o:image_bbx_data_layer.cpp:(.text+0xcf0): first defined here
file_a.cpp.o: In function `X':
file_a.cpp:(.text+0x26c0): multiple definition of `bob::io::image::read_gray_image(std::string const&, std::string)'
file_b.o:image_bbx_data_layer.cpp:(.text+0x17c0): first defined here
This can be solved by declaring the according functions inline
.