6

I have installed msys2/mingw64 because I need the g++ compiler. Now, I want to compile some c++ oce which requires openblas. I have installed the package using pacman -S mingw-w64-x86_64-openblas. However, compiling the code fails with

fatal error: cblas.h: No such file or directory

Clearly, the include path does not contain the headers from openblas which are located at C:\msys64\mings64\include\openblas. This is easy to fix by passing -I<include path> as an additional argument to g++.

Now, I was wondering whether there is an automated way to include include files/headers of installed packages in the g++ include path. The same problem also holds for libraries.

For example, pacman might be able to atomatically append these paths onto some environment variable which g++ checks.

1 Answers1

4

How do I include include files/headers of installed packages in the g++ include path?

You can set environment variables CPLUS_INCLUDE_PATH for include directories and LIBRARY_PATH for library directories. More information can be found in Environment Variables Affecting GCC

Source: c++ - Add extra include/lib paths to MinGW - Stack Overflow answer by Piotr Dobrogost

DavidPostill
  • 162,382