http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54483
Bug #: 54483 Summary: undefined reference to static constexpr in .so Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: bal...@gmail.com In a.hh --------- class A { static constexpr float val = 0.08; public: bool foo(const float v); }; In a.cc -------- bool A::foo(const float v) { return (v < -val); } Created a libfoo.so from the above code and linked this .so with another executable using A::foo(const float) method. Creating an executable result in "undefined reference to A::val" If I replace val with -0.08 and change foo method with return (v < val), val is getting inlined.