Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bob.io.image bob.io.image
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • bobbob
  • bob.io.imagebob.io.image
  • Issues
  • #27
Closed
Open
Issue created Jun 08, 2017 by Manuel Günther@mguentherMaintainer

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.

Assignee
Assign to
Time tracking