Software Archive
Read-only legacy content
17061 Discussions

MRAA common.hpp linker multiple definition error

William_H_1
Beginner
381 Views

I'm building a simple project including mraa.hpp in two source files, and getting a linker error for redefinition of the global functions declared (and implemented) in common.hpp, ex:

common.hpp:48: multiple definition of `mraa::getVersion()'

Looking at common.hpp, its a header file which implements several global functions in the mraa namespace. Is there a way to include this header file in multiple source files without redefining the method & causing linker errors? Is there a reason they are in the header and not the library? Should the compiler be inlining them? 

Thanks

0 Kudos
1 Reply
Matthias_H_Intel
Employee
381 Views

could you give some more insights:

  • how do you compile / link
  • where do you build? (within the Eclipse IDE or directly on the target?)
  • which version of mraa do you use?

 

0 Kudos
Reply