Lack of namespace causes issues with external build tools
Closed this issue · 1 comments
catmxt commented
We are compiling the library as part of an Unreal Engine project, which means ignoring the CMakeLists.txt. We have found that in certain situations, name collisions happen between elements in odrSpiral.cpp
and the included dependency pugixml.cpp
, causing a compilation failure.
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(4409): error C4459: declaration of 'sn' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(48): note: see declaration of 'sn'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(4426): error C4459: declaration of 'sn' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(48): note: see declaration of 'sn'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12606): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12627): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12649): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12669): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12702): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
...\libOpenDRIVE\thirdparty\pugixml\pugixml.cpp(12724): error C4459: declaration of 'sd' hides global declaration
...\libOpenDRIVE\src\Geometries\Spiral\odrSpiral.cpp(56): note: see declaration of 'sd'
Adding code in odrSpiral.h
and odrSpiral.cpp
to the odr
namespace resolves the issue.
pageldev commented
makes sense, thx!