[odb-users] compile error with libodb-qt module

Boris Kolpackov boris at codesynthesis.com
Tue Jun 9 09:52:55 EDT 2015


Hi Christian,

Christian Sell <christian at gsvitec.com> writes:

> I am setting up a fresh development environment with ODB 2.4, Linux Mint 17 and
> Qt 5.4.2 (64 bit). Not that this is the fist time that I have done seomething
> similar - but this is the first time I see the following error message when
> compiling the libodb-qt module:
> 
> QtCore/qglobal.h:1052:4: error: #error "You must build your code with position
> independent code if Qt was built with -reduce-relocations. " "Compile your code
> with -fPIC (-fPIE is not enough)."
> # error "You must build your code with position independent code if Qt was built
> with -reduce-relocations. "\
> 
> I was able to fix that by setting the CXXFLAGS environment variable to "-fPIC"
> before doing the ./configure. However, now when compiling my own code, I am
> getting the same message when the ODB compiler is invoked - and I have not been
> able to figure out how to mend this. Can anybody hint as to the reason why this
> occurs, and how to deal with it?

I assume you have the Qt profile enabled when running the ODB compiler.
If so, libodb-qt tries to take care of this: see odb/qt/details/config.hxx
for how and a detailed explanation of what's going on. But I guess
the Qt folks changed something in more recent versions of Qt so that
whatever we are doing no longer works. Would you be able to try and
figure out why?

Specifically, take a look into QtCore/qglobal.h:1052 and see why
defining __PIE__ is no longer sufficient. Also, maybe Qt no longer
defines QT_REDUCE_RELOCATIONS?

Thanks,
Boris



More information about the odb-users mailing list