1

This is a really basic question because I am a C++ newbie. I want to use the Boost.Interprocess library, but am having trouble building it. I'm trying to follow these instructions, but it's not working for me. Here is what I have:

#define BOOST_DATE_TIME_NO_LIB

#include <boost/interprocess/shared_memory_object.hpp>
#include <iostream>

using namespace std; 

int main() {
    cout << "Hello, beautiful world!\n";
}

But I get this error:

boost_1_55_0\boost\date_time\gregorian_calendar.hpp(63) : fatal error C1083: Cannot open include file: 'boost/date_time/gregorian_calendar.ipp': No such file or directory

I know Boost is able to load properly, because I can get an example that uses #include <boost/lambda/lambda.hpp> to work just fine. It's just when I try to include the Boost.Interprocess library that I am having trouble. The cause is clearly because it's having trouble including the Boost.DateTime library properly, but according to the documentation (linked above) I should be able to get by without separately compiling Boost.DateTime if I define BOOST_DATE_TIME_NO_LIB, right?

What am I missing here?

Steph
  • 2,135
  • 6
  • 31
  • 44
  • show how you call the compiler (options, include path etc) – quantdev Jul 23 '14 at 21:11
  • I'm using Visual Studio 2008, and I am just using the "Build Solution" (F7) command. The only change I made to the project's properties was to add to its "Additional Include Directories" the path to Boost, "$(SolutionDir)\lib\boost_1_55_0". Like I said, I know that this include is working properly because I was able to get a different example that used Boost to build and run properly. – Steph Jul 23 '14 at 21:43

2 Answers2

1

You need to add it to the preprocessor

In VS go to - Project >> properties >> C/C++ >> Preprocessor in the 'Preprocessor Definitions' paste BOOST_DATE_TIME_NO_LIB.

Bumble
  • 21
  • 5
0

You can download boost libraries here: https://www.boost.org/users/download/
After that, you can include them in your projects. Also, you can check this video on how to add boost libraries in eclipse IDE on Ubuntu: https://www.youtube.com/watch?v=gN8zrnWxFeI

Ahmed Hussein
  • 715
  • 1
  • 15
  • 38