[Interest] 5.8.0: "Could not find feature posix_fallocate" in sqlite.pri on Windows

Thiago Macieira thiago.macieira at intel.com
Mon Feb 6 22:39:25 CET 2017


On segunda-feira, 6 de fevereiro de 2017 22:18:14 PST mail at herrdiel.de wrote:
> Am 05.02.2017 um 19:33 schrieb Thiago Macieira:
> > [...] I was assuming that you tried to compile everything and it
> > succeeded
> > up until the point in the build that it tries to compile sqlite. Is that
> > not the case?
> 
> No, not at all - I've used the Qt installer. I've never dared to compile
> Qt myself. Sorry if I should have stated that more explicitly in my
> original post than I did, I tried to be brief and concise.

It wasn't clear, because we're talking about Sqlite here. The other SQL 
plugins often do require that you build them separately, as the client 
libraries aren't present on Windows. Even on Linux, the soname changes often 
for the MySQL library, so recompiling is often necessary.

Not so for Sqlite. The plugin should have come with your binary installation. 
So you should not need to recompile. The fact that you were trying was quite 
surprising.

BTW, why?

> > If it's not, explain what you're trying to do.
> 
> I want to compile a lib ("CuteEntityManager") that I use in my app. I

For my purposes, this is all "your code".

> use QtCreator 4.2.1 with pretty much the default settings. Compiling the
> lib works perfectly with the Qt5.7.1 kit, but with Qt5.8.0 there is the
> error message below. The compile output - in its entirety - is:
[cut]
> C:/Qt/5.8/mingw53_32/bin/qmake.exe -o Makefile
> ../../entitymanager/src/src.pro -spec win32-g++ CONFIG+=debug
> CONFIG+=qml_debug
> 
> Project ERROR: Could not find feature posix_fallocate.
> 
> Makefile:218: recipe for target 'Makefile' failed
> 
> mingw32-make[1]: Leaving directory
> 'C:/Users/SeDi/cpp/cit2/classintouch-2/ClassInTouch2/libs/build-EntityManage
> r-Desktop_Qt_5_8_0_MinGW_32bit2-Debug/src'

The problem is in entitymanager/src/src.pro. Please attach or give me a link 
to where it's present.

> I have tracked the problem down to sqlite.pri. There has been one single
> change in it from 5.7.1 to 5.8.0 - this is line 4:
> qtConfig(posix_fallocate): DEFINES += HAVE_POSIX_FALLOCATE=1

That line changing is normal and expected. What I don't get is:

a) how can this cause a problem, since clearly Qt compiled and thus the line 
worked when Qt was compiling [I have a theory, see below]

b) how sqlite.pri affects anything in your build. It's part of the Qt source 
code and simply cannot affect your code [also a theory].

> So something else must have changed between versions, that now seems to
> keep the compiler(?) from finding the "posix_fallocate" feature, whose
> very existence I had never been aware of before.

qmake, not the compiler.

My theory to explain the problem is:

The qtConfig qmake function only works inside the Qt build. It's not meant to 
be used by third-party code: that's why it works during the Qt build, but not 
when building your code.

And your code is trying to include(src/3rdparty/sqlite/sqlite.pri). That is 
not permitted. Fix your code to not do that.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list