[CMake] Problems with static jpeg library

world at masterdevops.eu world at masterdevops.eu
Tue Sep 11 10:10:21 EDT 2018


Hi,

thank you for your reply. I could solve the problem. The part I didn't 
knew was that static libraries also needed to be compiled with -fPIC. 
I've found a good summary of this topic at 
https://lists.debian.org/debian-devel/2016/05/msg00309.html
I want to share it for those, who also stumble upon this problem.


On 2018-09-11 13:47, Rolf Eike Beer wrote:
> world at masterdevops.eu wrote:
>> Hi,
>> 
>> I am trying to compile the project libgd
>> (https://github.com/libgd/libgd) with the option ENABLE_JPEG enabled.
>> 
>> I.e. first I downloaded the source code of libjpeg-turbo from
>> https://sourceforge.net/projects/libjpeg-turbo/files/2.0.0/, compiled 
>> it
> 
> You need to make sure that this compile includes -fPIC in the 
> compileflags of
> libjpeg.
> 
>> But I get several errors like this one:
>> > /usr/bin/ld: .../libjpeg-turbo-2.0.0/libjpeg.a(jcmainct.c.o):
>> > relocation R_X86_64_32S against `.text' can not be used when making a
>> > shared object; recompile with -fPIC
> 
> As said here.
> 
> Eike
> --

-- 
German DevPos site: https://www.masterdevops.eu


More information about the CMake mailing list