views:

231

answers:

1

Hey,

So I've been working on a project for the past number of weeks and it uses a number of Boost libraries. In particular I'm using the boost::dynamic_bitset library quite extensively.

I've had zero issues up until now; but tonight I discovered a dependency between some includes which I had to resolve; and I tried to do so by providing an abstract callback class.

Effectively I now have the following:

First include...

class OtherClassCallback
{
public:
    virtual int someOtherMethod() const = 0;
};

class SomeClass
{
public:
    void someMethod(OtherClassCallback *oc) {
        ...
        oc->someOtherMethod();
        ...
    }
};

Second include...

#include "SomeClass.h"

class SomeOtherClass : public OtherClassCallback
{
public:
    int someOtherMethod() const { return this->someInt; }
};

Here is the issue; ever since I implemented this class I'm now getting the following error:

fatal error C1083: Cannot open include file: 'boost/dynamic_bitset/dynamic_bitset.hpp': No such file or directory

Now I'm getting no other compiler errors; and it's a pretty substantial project. My include paths and so on are perfect; my files are fully accessible and removing the changes fixes the issue. EDIT: I should highlight the fact the error is occurring in a file which neither directly includes and which hasn't been altered in any other way.

Does anyone have any idea what might be going on? I'm compiling to native Windows executables in VS9.

I should confess that I'm very inexperienced with C++ in general so go easy on me if it's something horribly straightforward; I can't figure it out.

A: 

So it turns out one of my executables which was using SomeOtherClass did not have the Boost libraries in its include list. I would have realised this earlier if I paid more attention to the output logs.

3>c:.. ClassUsingDynamicBitset.h(2) : fatal error C1083: Cannot open include file: 'boost/dynamic_bitset/dynamic_bitset.hpp': No such file or directory

3>SomeClassInExecutableProjectWhichDidntPreviouslyRequireBoostHeaders.cpp

2>Build log was saved at "file://c:...\BuildLog.htm"

2>some_library_already_including_boost_libraries - 0 error(s), 1 warning(s)

Effectively I failed to realise that VS was concurrently building my libraries/executables as I played with the headers; and it was in fact an executable which previously knew nothing about the class which included the Boost library where the problem lay.

As soon as I extended the aforementioned class to implement the Callback interface I introduced a dependency back down to the Boost library; and I failed to ensure each of my projects using said class were including all required headers.

ronivek