Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. X11/Xlib.h: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

X11/Xlib.h: No such file or directory

Scheduled Pinned Locked Moved Unsolved General and Desktop
34 Posts 3 Posters 26.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marvic_39
    wrote on last edited by marvic_39
    #1

    Hello,

    Cross compiling Qt for ARM board.

    Installed all the depencies from this http://wiki.qt.io/Building_Qt_5_from_Git

    sudo apt-get build-dep qt5-default
    
    sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev
    

    If this option is given -no-xcb no errors, makefile get created.
    If it's -qt-xcb than this the error, Searched the xlib.h no file in the source tree.

    
    /home/mars/qt-everywhere-opensource-src-5.5.1/qtbase/config.tests/x11/xlib/xlib.cpp:34:22: fatal error: X11/Xlib.h: No such file or directory
     #include <X11/Xlib.h>
                          ^
    compilation terminated.
    make: *** [xlib.o] Error 1
    
    

    How to solve this.

    Thank you,
    Answers Appreciated

    1 Reply Last reply
    0
    • RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @marvic_39
      You can add Xlib.h to your system by running the following...

      sudo apt-get install libx11-dev

      --Alles ist gut.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        marvic_39
        wrote on last edited by marvic_39
        #3

        Yes, libx11-dev is already installed.
        All these are already installed.

        sudo apt-get install libx11-dev libavahi-gobject-dev libSM-dev libfontconfig-dev 
        libXext-dev libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev 
        libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Did you install these for your target ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Did you install these for your target ?

            M Offline
            M Offline
            marvic_39
            wrote on last edited by marvic_39
            #5

            @SGaist
            Cross compiling for Odroid, above error flashed.

            For BeagalBone board with same configuration -qt-xcb able to build and installed.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              marvic_39
              wrote on last edited by
              #6

              I Searched it again xlib.h is in system dir /usr/include/X11
              Used PATH to this folder, still it's flashing the error.

              Do i have to do any path settings in qmake.conf located at this

              /home/mars/qt-everywhere-opensource-src-5.5.1/qtbase/mkspecs/devices/linux-odroid-xu4-g++
              

              or

              /home/mars/qt-everywhere-opensource-src-5.5.1/qtbase/mkspecs/linux-arm-linaro-gnueabihf-g++
              
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Since you're cross-compiling, you should get them for your target device.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply
                0
                • SGaistS SGaist

                  Since you're cross-compiling, you should get them for your target device.

                  M Offline
                  M Offline
                  marvic_39
                  wrote on last edited by marvic_39
                  #8

                  @SGaist

                  Ok. But, Same setup worked for other ARM device and able to compile apps.

                  Why it is not working for this device? Installed the dependencies.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Without any details about your device/linux distribution it's pretty much Crystal Ball Debugging. As to why its working for other devices: what is different between these other devices and this one ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Without any details about your device/linux distribution it's pretty much Crystal Ball Debugging. As to why its working for other devices: what is different between these other devices and this one ?

                      M Offline
                      M Offline
                      marvic_39
                      wrote on last edited by marvic_39
                      #10

                      @SGaist

                      Sorry, i have not mentioned it.

                      I am not compiling on target board directly. Cross compiling using Linaro tool chains for Odroid XU4.

                      Took this source code qt-everywhere-opensource-src-5.2.0
                      For BeagalBone "-qt-xcb" option in configure worked without any error and build created. qmake worked fine in QtCreator.

                      For Odroid XU4 "-qt-xcb" option in configure flashing error

                      **X11/Xlib.h: No such file or directory**
                      

                      If it is -no-xcb this will get compiled and build created without that error.
                      Even if i do not give xcb option in configure it compiles and builds the code.

                      So, how to build for Odroid XU4 with xcb support.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        You have to add the needed Xorg dev packages to your Odroid sysroot

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        M 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          You have to add the needed Xorg dev packages to your Odroid sysroot

                          M Offline
                          M Offline
                          marvic_39
                          wrote on last edited by marvic_39
                          #12

                          @SGaist

                          Well, i am not using sysroot. Instead , Using -prefix option so that all that make install stuff goes to /usr/local/qt-5.2-odroid.

                          Created a folder in /home/odroid, Did the configure with below options,

                          ../qt-everywhere-opensource-src-5.2.0/configure -v -opensource -confirm-license
                          -prefix /usr/local/qt-5.2-odroid -no-largefile -no-accessibility -qt-zlib -no-gif -qt-libpng 
                          -qt-libjpeg -no-nis -no-cups -xplatform linux-arm-linaro-gnueabihf-g++ -device linux-
                          odroid-xu4-g++ -device-option CROSS_COMPILE=/usr/local/linaro/bin/arm-linux-
                          gnueabihf- -no-xcb -no-c++11 -no-pch -nomake examples
                          

                          This will build, with -no-xcb option.

                          From Qt Creator i will set the Compiler, Kit and qmake. Just build and deploy.
                          And it worked well on Odroid XU4

                          How to get through with -qt-xcb option for Odroid.
                          For BeagalBone it works with -qt-xcb option.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Then you have to provide all missing headers and libraries in your cross-compiler folders

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            M 1 Reply Last reply
                            0
                            • SGaistS SGaist

                              Then you have to provide all missing headers and libraries in your cross-compiler folders

                              M Offline
                              M Offline
                              marvic_39
                              wrote on last edited by marvic_39
                              #14

                              @SGaist

                              Yes, i copied all the required headers to that folder. Set PATH to that folder also.
                              Still it's flashing error.

                              For beagalbone, it compiled properly. How did that .conf file searched the files.

                              Wjy Odroid .conf is not ? Any thing to be done for PATH setting

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                You didn't provide the libraries.

                                When cross-compiling, the compiler and linkers need to be able to access both the headers and corresponding libraries for the device or at least the architecture your are building for. These are usually provided in the sysroot of your device along with specific stuff to access e.g. the GPU so that you are building against the same set of libraries you'll be using for your device.

                                Since you don't want to use the sysroot of your device, then you have to add everything by hand for your cross-toolchain to find.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                M 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  You didn't provide the libraries.

                                  When cross-compiling, the compiler and linkers need to be able to access both the headers and corresponding libraries for the device or at least the architecture your are building for. These are usually provided in the sysroot of your device along with specific stuff to access e.g. the GPU so that you are building against the same set of libraries you'll be using for your device.

                                  Since you don't want to use the sysroot of your device, then you have to add everything by hand for your cross-toolchain to find.

                                  M Offline
                                  M Offline
                                  marvic_39
                                  wrote on last edited by marvic_39
                                  #16

                                  @SGaist

                                  I understood about that, but

                                  For beagalbone ( Without sysroot ), build created and linked all libraries automaticall, i have not added any headers or libraries manully. This toolchain(Angstrom) having all the headers and correct paths.

                                  Same thing should go with Odroid?
                                  I am using this tool chain gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux to build Qt on Odroid. And this toolchains does not have few headers related xcb and others. Manually i added some. Libraries not located after searching.

                                  Any specific tool chains to build for Odroid XU4 .

                                  If build is without xcb, what all the features will be missing?

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    Because Angstrom is not just a toolchain, it's a distribution. gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux is only a toolchain.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    M 1 Reply Last reply
                                    0
                                    • SGaistS SGaist

                                      Because Angstrom is not just a toolchain, it's a distribution. gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux is only a toolchain.

                                      M Offline
                                      M Offline
                                      marvic_39
                                      wrote on last edited by
                                      #18

                                      @SGaist

                                      I could not find xlib libraries in the system, even after installing all the dependencies.

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        How did you install the dependencies ?

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        M 1 Reply Last reply
                                        0
                                        • SGaistS SGaist

                                          How did you install the dependencies ?

                                          M Offline
                                          M Offline
                                          marvic_39
                                          wrote on last edited by
                                          #20

                                          @SGaist

                                          sudo apt-get install libx11-dev libavahi-gobject-dev libSM-dev libfontconfig-dev
                                          libXext-dev libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev
                                          libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved