including boost directory path to compiler and linker library path

I've already built the Boost libraries. But I need to add somehow C:\boost_1_60_0 to the compiler include paths; I'm using VS 2015. I also need to add another directory path to the linker library path as shown below:


1 file(s) copied.
...updated 3 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

C:\boost_1_60_0

The following directory should be added to linker library paths:

C:\boost_1_60_0\stage\lib


C:\boost_1_60_0>

I've tried gcc I-C:\boost_1_60_0 for the compiler path and -L C:\boost_1_60_0\stage\lib for the linker but to know avail. I've tried variations as well.
Am I missing something? Any help will be greatly appreciated. Perhaps this is way I'm getting an error in VS when I try to run a little program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "stdafx.h"
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;


int main()
{
	typedef std::istream_iterator<int> in;

	cout << "Type in any number: ";

	for_each(
		in(std::cin), in(), std::cout
		<< (boost::lambda::_1 * 10)
		<< "\nType in another number: ");
	return 0;
}


The error in question is "cannot open include file C:/Lib/boost/lambda/lambda.hpp: no such file or directory", which doesn't make sense because I've already ascertained the existence of this file.
Last edited on
I've tried gcc I-C:\boost_1_60_0


The syntax isn't I-, it's -I

I would also recommend using / instead of \



cannot open include file C:/Lib/boost/lambda/lambda.hpp: no such file or directory

From what you said above, looks like the include directory isn't C:/Lib/boost/ ; it's C:/boost_1_60_0
Last edited on
Tried it. It still says
1
2
gcc: fatal error: no input files
compilation terminated
for the compiler
Last edited on
Ah. I see. Perhaps I need to explain more.

gcc is a command line tool that accepts a number of input parameters.

For your purposes, the important input parameters here are:

The include directories, each of which is prefixed -I
The link directories, each of which is prefixed -L
The link libraries, each of which is prefixed -l (that's a lower case L)
The actual input source files to build

So if you just typed gcc -IC:\boost_1_60_0 then you left out:
The link directories
The link libraries
The actual input source file to build


Given that you want to code in C++, you might find that g++ is to be used, rather than gcc (which, by default, is a C compiler).
Last edited on
Thanks for your kind answer. I'll give this a try again.
Topic archived. No new replies allowed.