tags:

views:

136

answers:

3

i have posted this question third times please help i have following code

#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>
#include <boost/system/windows_error.hpp>

using namespace boost::system;

int main(){

    boost::asio::io_service io;
    boost::asio::deadline_timer t(io,boost::posix_time::seconds(5));
    t.wait();
    std::cout<<"hello world";
    return 0;
}

and error is

1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_44.lib'

please i dont know how and what do and can you explain steps?

+3  A: 

Ok, for MSVC++ 2010

Under Project Properties, goto

Configuration Properties -> Linker -> General -> Additional Library Directories and add there the path to the *.lib file (For example: C:\boost_1_41_0\stage\lib)

Prasoon Saurav
yes but in case of i indicate full path of boost library itself why not work? for example i have boost on desktop so i will indicate pathC:\Users\David\Desktop\boost_1_44_0
You have to add the `*.lib` file's path separately(to the linker search path) as I have suggested.
Prasoon Saurav
i have done but not works because i need other linker path like network asio
@Algorithms: Add the `lib` directory's path. For example if `libboost_system-vc100-mt-gd-1_44.lib` is present in `C:\Users\David\Desktop\boost_1_44_0\stage\lib` you have to add that.
Prasoon Saurav
i have indicate this linkC:\Users\David\Desktop\boost_1_44_0\stage\lib but not works
@algorithms : What do mean by `indicate`?
Prasoon Saurav
my project name is networking.cpp so right click mouseproperties include additional directories and paste full path of *.lib files
@algorithms : Do not right click on the `*.cpp` file. Right click on the project and then do whatever I have written in my answer.
Prasoon Saurav
ouuuu @Prasoon thanks very much thank you
@algorithms : Now you can safely accept my answer and upvote it if you want :)
Prasoon Saurav
i have accept but can't upvote because it requires 15 reputation
+1  A: 

As far as I can tell from the error message it compiles but can't find the boost compiled libraries.

These you have to build yourselves unless you can find them prebuilt.

IIRC boost are built using a tool called bjam. I think this explains it rather throughly: http://www.highscore.de/cpp/boostbuild/index.html.

After it's built you have to instruct the compiler to link it using the project properties.

FuleSnabel
ok listen guys i have downloaded boost librarys and built it so i dont understand built again?ok i say directly show please exactly what to do please help me
A: 

I suspect you haven't built the libraries. You can get the pre-built libraries from BoostPro or you can build them yourself following the instructions at http://www.boost.org/doc/libs/1_44_0/more/getting_started/windows.html

SilverSun