0
votes

I need to include header files from sqlite3x library (or from sqlite) in my project. I've just created new project in Qt Creator and added the following lines in .pro-file:

INCLUDEPATH += $$quote(D:/libs/libsqlite3x-2007.10.18) INCLUDEPATH += $$quote(D:/libs/sqlite-amalgamation-3071502)

Then i've tried to include

#include <sqlite3x.hpp>

and compile.

Cannot open include file: 'sqlite3.h': No such file or directory

Why?

If i write

#include <sqlite3.h>

i've got the same error.

When i write this preprocessing directive, Qt Creator gives me an autocompletion and if i press F2 on this line it'll open this file.

http://pastie.org/7670341 http://pastie.org/7670574

1
Can you add output of dir or ls -l command proving that this file exists? - PiotrNycz
@PiotrNycz Done - pastie.org/7670341 - FrozenHeart
Can you show the compiler command line from the build log? - Michael Burr
@Michael Burr Done - pastie.org/7670574 - FrozenHeart
Have you re-run qmake? And are the two INCLUDEPATH items on separate lines (it's not clear that they are in the question formatting)? - Michael Burr

1 Answers

0
votes

You need

INCLUDEPATH += $$quote(D:/libs/libsqlite3x-2007.10.18) $$quote(D:/libs/sqlite-amalgamation-3071502)

If you see http://pastie.org/7670574 these are the include directives

-I"D:\libs\libsqlite3x-2007.10.18" -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtWidgets" -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtSql" -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"release" -I"." -I"." -I"D:\libs\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-msvc2010"

If you look - you don't see D:/libs/sqlite-amalgamation-3071502. Your build tool is not picking up the directory & adding it to the INCLUDEPATH because only it picks up only one INCLUDEPATH line - so both to the same INCLUDEPATH line with a space separating them.