kevinresol / exp-ecs

Experimental macro-powered Entity-Component-System game engine
59 stars 5 forks source link

package name exp clashes with std::exp() #6

Closed sh-dave closed 9 months ago

sh-dave commented 4 years ago

i tried to do a native linux compile in a kha based project and that fails. i don't think this is related to khacpp (a fork of hxcpp)

In file included from ../../../Kha/Backends/Kore/khacpp/include/hxcpp.h:364:0:
../Sources/include/hxinc/exp/ecs/Engine.h:9:19: error: ‘namespace exp { }’ redeclared as different kind of symbol
 HX_DECLARE_CLASS2(exp,ecs,Delay)
                   ^
../../../Kha/Backends/Kore/khacpp/include/hx/Macros.h:19:52: note: in definition of macro ‘HX_DECLARE_CLASS2’
 #define HX_DECLARE_CLASS2(ns2,ns1,klass) namespace ns2 { HX_DECLARE_CLASS1(ns1,klass) }
                                                    ^~~
In file included from /usr/include/c++/6/math.h:36:0,
                 from ../../../Kha/Backends/Kore/khacpp/include/hxMath.h:8,
                 from ../Sources/src/impl/MovingSystem.cpp:6:
/usr/include/c++/6/cmath:245:3: note: previous declaration ‘constexpr float std::exp(float)’
   exp(float __x)
   ^~~
kevinresol commented 4 years ago

Seems like there is a collision between the std function std::exp and the exp namespace generated by the haxe exp package? I have almost no knowledge of c++ but I think this is more a problem of the generator.