This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Arithmetic type emulator helper class for testcases.


On Tue, Jul 15, 2008 at 6:37 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> ... the definition of struct system_clock (not a template) seems indeed an excellent candidate for a *.cc file (by the way, as-is, you have a static const bool which needs a definition and a pure header solution is not an option)
>
> Paolo.
>
>

Attached is a patch with just a subset of the full patch. I moved the
is_monotonic static member var and the "now()" static member function
to chrono.cc. I tried to model it after mutex and condition_variable
but linking anything against libstdc++.so gives two linker error's.

(Note that, on my x86_64 machine, the configuration does define
_GLIBCXX_USE_GETTIMEOFDAY)

libstdc++.so: undefined reference to
'std::common_type<std::chrono::duration<long, std::ratio<1l, 1l> >,
std::chrono::duration<long, std::ratio<1l, 1000000l> > >::type
std::chrono::operator+<long, std::ratio<1l, 1l>, long, std::ratio<1l,
1000000l> >(std::chrono::duration<long, std::ratio<1l, 1l> > const&,
std::chrono::duration<long, std::ratio<1l, 1000000l> > const&)'

libstdc++.so: undefined reference to
'std::common_type<std::chrono::duration<long, std::ratio<1l, 1000000l>
>, std::chrono::duration<long, std::ratio<1l, 1000000l> > >::type
std::chrono::operator+<long, std::ratio<1l, 1000000l>, long,
std::ratio<1l, 1000000l> >(std::chrono::duration<long, std::ratio<1l,
1000000l> > const&, std::chrono::duration<long, std::ratio<1l,
1000000l> > const&)'

Sorry for the formatting but basically it can't find operator+ for
durations (the first is the seconds + microseconds). Both additions
are valid so I figure I haven't integrated chrono.cc correctly into
the build system or I'm just doing something silly...

Chris

Attachment: chrono_patch_link_error.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]