[CMake] Include directories problem when cross compiling with MinGW

Maciej Mrozowski reavertm at gmail.com
Mon Sep 12 17:22:00 EDT 2016


On piątek, 2 września 2016 13:12:27 CEST David Demelier wrote:

> Do you have any clue?

It seems your toolchain does not have include/library path built-in or they 
are different that those it was built with.
You can inspect them by passing one of below parameters to mingw-*-gcc:

  -print-search-dirs       Display the directories in the compiler's search 
path
  -print-libgcc-file-name  Display the name of the compiler's companion 
library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component <prog>
  -print-multiarch         Display the target's normalized GNU triplet, used 
as
                           a component in the library path
  -print-multi-directory   Display the root directory for versions of libgcc
  -print-multi-lib         Display the mapping between command line options 
and
                           multiple library search directories
  -print-multi-os-directory Display the relative path to OS libraries
  -print-sysroot           Display the target libraries directory
  -print-sysroot-headers-suffix Display the sysroot suffix used to find 
headers

In any case, you should additionally set sysroot via CMAKE_CXX_FLAGS (or 
CMAKE_CXX_COMPILER) in your toolchain file:

--sysroot=dir

-- 
regards
MM


More information about the CMake mailing list