I have written the 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 I get the following error:
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_44.lib'
I dont know how and what do, can you please explain what is happening and what steps I can take to fix it?
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
)
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With