[Interest] QtCreator oddity

Roland Hughes roland at logikalsolutions.com
Wed Apr 18 19:03:45 CEST 2018

On 04/18/2018 11:52 AM, Konstantin Tokarev wrote:
> 18.04.2018, 19:43, "Roland Hughes" <roland at logikalsolutions.com>:
>> All,
>> KDE Neon all updates applied. QtCreator 4.4.1  Qt 5.9.3 from repos. Also installed libusb packages from repos.
>> roland at roland-I5-HP-Compaq-8300-Elite-SFF-PC:~$ ls /usr/include/libusb-1.0/
>> libusb.h
>> When typing in the editor and compiling, libusb.h is not found. Other headers from other directories in /usr/include are found, but not libusb.h. If I force QtCreator to look at it via
>> INCLUDEPATH +=/usr/include/libusb-1.0
>> in the .pro file, all is well. I assume there is a bug when it comes to directories with "." in the name. Just passing this along.
> This is expected behavior. Unlike /usr/include, /usr/include/libusb-1.0 is not in default search path of compiler, so you have to add it explicitly
I would buy that argument if postgresql and all of the other directories 
under /usr/include didn't work just fine. Either their packages add an 
entry where the compiler suddenly knows about them _or_ the directory 
tree under /usr/include is "walked."

To test this theory I did the following:
removed INCLUDEPATH from .pro file and saved
cd /usr/include
dir aa
sudo mkdir aa
sudo cp libusb-1.0/*.h aa

Now typing

#include <a

brings up the aa/ completion entry and libusb.h is found under it.

This is a manually entered directory. To further test I did the following

sudo mkdir a.a
sudo cp libusb-1.0/*.h a.a
roland at roland-I5-HP-Compaq-8300-Elite-SFF-PC:/usr/include$ dir a.a

typing #include <a  still only brings up aa/ in the completion list. a.a 
is not found.

There appears to be a problem walking the directory tree when a 
directory name includes the "."


Roland Hughes, President
Logikal Solutions


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180418/b350b7eb/attachment.html>

More information about the Interest mailing list