简体   繁体   中英

How do I install Boost.signals2 into my project?

I'm having trouble succesfully including Boost.signals2 in my project so i can have an event-like system for button presses with my OpenGL window. I downloaded boost.signals2 from its github page and took the contents of the Include folder, and put it into my own Include folder that i have included in my project (this is so i can just add stuff i need as i go and have something i can share across projects).

Problem is, when i build my project after including Boost.signals2, and having the line #Include <boost/signals2/signal.hpp> i am presented with a bunch of errors from all the Boost.signals2 headers, all of which are cannot open source file "boost/config.hpp": No such file or directory or some other boost/{x}.hpp . I'm at a total loss as to where i'm going wrong. As far as i understand, i do not have to build the Boost.signals2 library as it is header only, but maybe i am wrong? How can install Boost.signals2?

You have to add the include path for the complete boost libraries to your compile flags.

If you extracted the tarball in directory XYZ, the include path would just be that (so -I XYZ or -isystem XYZ ).

Signals2 in particular is header only, so it doesn't need to be built and/or linked.

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