Denis Shevchenko
Denis Shevchenko

Reputation: 1448

Boost precompiled headers problem

I try to precompile Boost headers.

First experiment - with std:: headers. I create file std.hpp:

#include <vector>
#include <iostream>
// And other std:: headers

After that:

g++ std.hpp

Copy std.hpp.gch in /usr/include/c++/4.4.5

And write test program:

#include <std.hpp>

int main() {
    std::cout << "Hello, precompiled world!" << std::endl;
    return 0;
}

Works fine.

Now try precompile Boost headers.

I create boost.hpp file:

#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/karma.hpp>

After that:

g++ boost.hpp

Copy boost.hpp.gch in /usr/local/include/boost

And write test program:

#include <boost/boost.hpp>

int main() {
    // Some code...
    return 0;
}

But got error:

main.cpp:2:33: error: /usr/local/include/boost/boost.hpp: No such file or directory.

Try, for experiment:

#include </usr/local/include/boost/boost.hpp>

int main() {
    // Some code...
    return 0;
}

Same error.

Try copy boost.hpp.gch in another place - same error.

If I put file boost.hpp in same place - works fine (so there is no problems with path):

ls /usr/local/include/boost | grep boost
boost.hpp
boost.hpp.gch

So compiler use boost.hpp header. But why compiler don't see precompiled boost.hpp.gch??

Upvotes: 4

Views: 2295

Answers (1)

trenki
trenki

Reputation: 7363

This might be a gcc bug as documented in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46110

Upvotes: 3

Related Questions