72

I'm working with QT and embedded devices and in many documentation items ( like here) they are talking about sysroots. I've searched the web but I couldn't find anything about what a sysroot is. I have a cross-compiler-toolchain though. What's a sysroot and how do I create one ?

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Teee
  • 994
  • 1
  • 11
  • 22
  • 2
    To answer the second part of the question... something like http://crosstool-ng.github.io may help to create the sysroot – twodayslate Dec 06 '19 at 20:13

1 Answers1

102

A sysroot is a directory which is considered to be the root directory for the purpose of locating headers and libraries. So for example if your build toolchain wants to find /usr/include/foo.h but you are cross-compiling and the appropriate foo.h is in /my/other/place/usr/include/foo.h, you would use /my/other/place as your sysroot.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
  • 4
    I would find this answer more useful if it clarified the differences between sysroot and a staging directory. – mallwright Dec 30 '21 at 08:14