You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Platform.Memory.h includes memory_mapped_file.cpp and defines non-inline functions in headers (multiple definition link errors) #124
b.cpp:(.text+0x0): multiple definition of `memory_mapped_file::mmf_granularity()'; a.cpp: first defined here
b.cpp:(.text+0x14): multiple definition of `memory_mapped_file::base_mmf::base_mmf()'
...
exit status of link: 1
Proposed solution
Mark all namespace-scope functions inline, and make PageSize an inline variable (or a function with a static local).
Stop including the .cpp: either make it header-only with inline, or remove the unused memory_mapped_file.* files, since mio is what is actually used.
Each header should be self-contained (#pragma once plus its own includes).
Activity