简体   繁体   中英

problem in boost in l win7

i am using visual c++ 2010 in win7 i have following code

#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
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;



}

but i have errors

1>------ Build started: Project: networking, Configuration: Debug Win32 ------
1>  networking.cpp
1>  Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
1>  - add -D_WIN32_WINNT=0x0501 to the compiler command line; or
1>  - add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.
1>  Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_44.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

OK, now that you use Visual C++, Boost libraries will get auto-linked, however you need to build them first. In this case you need to build just Boost.System. Then add the necessary directory as Additional Library Directories to get it working. See here for details: http://www.boost.org/doc/libs/1_44_0/more/getting_started/index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM