0

I am trying to get the Boost library working.

I have included the path in my c_cpp_properties.json

"includePath": [
                "C:\\MinGW\\boost_1_70_0"
            ]

although IntelliSense finds the libraries after I try to #include them, when actually #including them i get this error:

fatal error: boost/lexical_cast.hpp: No such file or directory
 #include <boost/lexical_cast.hpp>

I am missing something?

  • What build system do you use for your project? (i.e. CMake, SCons, etc.) – Deedee Megadoodoo May 08 '19 at 08:19
  • I installed the MinGW g++ compiler and use that – Mick Remmerswaal May 08 '19 at 08:20
  • 1
    IntelliSense != build system. You have to tell your compiler or build system where the boost files are. – skratchi.at May 08 '19 at 08:23
  • 1
    You can tell gcc which directories to use to search for includes and libraries and which libraries to link with, but it's even better to use an existing build system like CMake. It won't take much time to learn basics of them but it will be very useful later and allow you not to go into details of each concrete compiler you use to compile your program. – Deedee Megadoodoo May 08 '19 at 08:27
  • 1
    Also, AFAIK boost supplies libraries build with MSVC, they are probably won't be linked against program built with gcc. – Deedee Megadoodoo May 08 '19 at 08:35
  • @RealFresh If MSVC delivers a `lib` or a `dll`, why should `MinGW` not be able to link them? It still operates on windows ¯\\_(ツ)_/¯ – skratchi.at May 08 '19 at 08:38
  • MSVC and MinGW (gcc) have different name mangling. There's a bunch of answers on the subject: https://stackoverflow.com/questions/8977971/using-msvc-lib-files-with-mingw-name-mangling or https://stackoverflow.com/questions/2529770/how-to-use-libraries-compiled-with-mingw-in-msvc – Deedee Megadoodoo May 08 '19 at 08:40
  • @RealFresh why is `MinGW` itself having a wiki entry that says otherwise? mingw.org/wiki/msvc_and_mingw_dlls (´-`).。oO( ... ) – skratchi.at May 08 '19 at 08:55

0 Answers0