I'm trying to add boost libraries on eclipse c++. I have done all steps. But It couldn't. The error is said that ..\src\dfsdf.cpp:3:10: fatal error: boost/filesystem.hpp: No such file or directory
. I share some picture about my screen which explains everything. What's wrong ? How can i add or use these library ?
Thanks in advance
Asked
Active
Viewed 345 times
-2

Ugur Ç.
- 3
- 6
-
Please post your code as text, not images. For someone like me where imgur is blocked, or for the vision impaired your question is unanswerable – NathanOliver Jul 13 '18 at 19:36
-
It is not a code question. It is a question which means how to add the library to path. :/ – Ugur Ç. Jul 13 '18 at 19:37
-
@UgurÇ. May be [this](https://stackoverflow.com/questions/24715864/problems-importing-libraries-to-my-c-project-how-to-fix-this) helps. – πάντα ῥεῖ Jul 13 '18 at 19:39
-
@πάνταῥεῖ I checked this. But yeah, I have done these steps, properly. I mean, I have followed preferences of the project. Then, I have done add the path to C++ Build include. However, It did not change anything ! – Ugur Ç. Jul 13 '18 at 19:48
-
@UgurÇ. If you want to make things more difficult for the people you are asking help from, that is your choice. However, it would be appropriate to copy (as text) the *code* from your first image into your question, followed by the console output. Your second and third images do not contribute to understanding your situation more than the first, as far as I can tell. – JaMiT Jul 13 '18 at 20:45
-
@JaMiT okay, you are right. The main idea of the question is that how it is added library in c++. It does not matter adding which library. But okay, I respect your opinion and I will be careful after this. Thank you for warning ! – Ugur Ç. Jul 13 '18 at 21:40
1 Answers
0
This is just a guess since you did not mention where Boost's filesystem.hpp
resides on your system, but I suspect you are getting a repeated directory name when the compiler tries to find this included file. Try changing your include path from C:\boost_1_66_0\boost
to just C:\boost_1_66_0
.

JaMiT
- 14,422
- 4
- 15
- 31
-
Okay I tried this. It works until another error. Now, errors are **C:\Users\ugurc\eclipse-workspace\dfsdf\Debug/../src/dfsdf.cpp:15: undefined reference to `boost::filesystem::path::filename() const' src\dfsdf.o: In function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const': C:/boost_1_66_0/boost/system/error_code.hpp:676: undefined reference to `boost::system::generic_category()' C:/boost_1_66_0/boost/system/error_code.hpp:679: undefined reference to `boost::system::generic_category()'** – Ugur Ç. Jul 13 '18 at 21:46
-
@UgurÇ. that is progress; you made it through the compiler and are now stuck on the linker. Make sure the Boost Filesystem library is among the libraries listed for the linker. – JaMiT Jul 14 '18 at 02:44