Boost logo

Boost Users :

Subject: [Boost-users] undefined reference to boost::hash_range
From: Michael Dickey (mike_at_[hidden])
Date: 2012-10-17 13:14:37


I ran into an odd error with 1.51.0 when compiling the following code
using gcc 4.4.6 on rhel6/64 with -fkeep-inline-functions (using this
flag for debug builds):

#include <boost/filesystem/path.hpp>
int main(void) {
     boost::filesystem::path a_path;
     return 0;
}

The linker complains about an undefined reference to boost::hash_range<>
referenced from boost/filesystem/path.hpp.

Looking at path.hpp I can see it includes hash_fwd.hpp not hash.hpp.
This is despite the fact that it's actually using various hash methods
inside the header file (including hash_range). When I change it to use
hash.hpp instead, the linker error goes away.

Should path.hpp really use hash.hpp instead, or is this some weird
compiler issue, or something else entirely? I figured someone here
would know =)

Thanks,
-Mike


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net