From: Sean M. <se...@ro...> - 2011-05-24 15:55:59
|
On Mon, 23 May 2011 12:46:40 -0400, Brad King said: >> 2. vnl_test_all cannot be linked because of missing symbols (see >> output below). It turned out the static const variables are declared >> and initialized in the header, but not **defined**. My understanding >> of C++ 98 standard 9.4.2/2 is if these variables are used in places >> other than integral expression, they need to be defined. If I remove >> the "#if !VCL_STATIC_CONST_INIT_INT_NO_DEFN" guards in >> core/vnl/vnl_numeric_traits.cxx, the related linking errors went away. >> >> Well, two things I want to check with the community. First, is my >> understanding of the standard correct? > >Yes, IIRC. > >> Second, even if it is, I recall the VCL_STATIC_CONST_INIT_* macros >> had been introduced mostly to fix broken compilers. Any suggestions >> on how shall we proceed? > >I think Sean McBride (CCed) has built vnl with Clang inside ITK. >Sean, did you see/fix any problems like this in ITK's vnl? Sorry for the delay, it was a holiday here yesterday. I submit nightly dashboards of both ITK and vxl, both built using clang, but not the clang from Xcode 4, but rather a build from a recent svn revision. I update it every few weeks. They both build these days, but did not at first. Regarding #2, though clang is right to warn/error, such code is very common and _is_ conformant as of C++0x. As such, IIRC, the clang folks changed it from error to warning at some point. I believe clang also defaults to C++03, and so this warning is on, but if you specify C++0x, then you should get no warning. I guess, strictly speaking, vxl either needs to change, or require C+ +0x. But in practice, most compilers seems to be forgiving enough. -- ____________________________________________________________ Sean McBride, B. Eng se...@ro... Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada |