ROCR-Runtime
ROCR-Runtime copied to clipboard
Multiple definition of `HSA_VEN_AMD_AQLPROFILE_LEGACY_PM4_PACKET_SIZE'
I am trying to use the Rocprofiler library in a project, but if the header is included in multiple source files, the linker throws the following error:
multiple definition of `HSA_VEN_AMD_AQLPROFILE_LEGACY_PM4_PACKET_SIZE'
I tracked the problem down to this line in the hsa_ven_amd_aqlprofile.h
header file from HSA:
https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/ea47a79081e0293a5256b7fb908941c3ffb38468/src/inc/hsa_ven_amd_aqlprofile.h#L230
When included in two source files, the same definition appears twice, which the linker cannot handle.
If I am not including the library wrong, a possible fix could be to make it an external declaration and define it in one source file, or to make the definition static.
Best regards, Marcel