Problem compiling glib using static zlib


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Problem compiling glib using static zlib
# 1  
Old 02-01-2017
Problem compiling glib using static zlib

Hello I have been trying to compile glib 2.28 with needs Zlib. During the compilation process I received these messages
Quote:
CCLD libgio-2.0.la
/usr/bin/ld: /media/34GB/Arquivos-de-Programas-Linux/Zlib-1.2.8-64//lib/libz.a(deflate.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/media/34GB/Arquivos-de-Programas-Linux/Zlib-1.2.8-64//lib/libz.a: could not read symbols: Bad value
Then giving a look at the configure of Zlib, there was an option to static link it and I obviously used it.

So I think I can solve it by compiling a shared zlib, or by compiling the glib libraries statically static, but I would like to try to use this -fPIC flag to generate shared glib libraries from a static Zlib. Then I edited the glib Makefile, and where there was
Quote:
CFLAGS = -g -O2 -Wall
I added a
Quote:
-fPIC
in the end. Then I typed
Quote:
make
again, but the error messages remains. Can I do anything?
Many thanks.
# 2  
Old 02-02-2017
I'm not convinced -fPIC makes sense for static code.

Make sure you're using the right object. A .a file is usually used with an .so file.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 02-02-2017
Well, that's the only library file created. The rest are two include files and a man file.
# 4  
Old 02-03-2017
What compile flags are libgio being compiled with?
# 5  
Old 02-03-2017
I looked into the Makefile and didn't see anything with libgio in there. What should I look for?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 problem with static ip

I have installed Solaris 11.2 in VMware Player, networked in bridged mode. When Solaris uses DHCP everything is OK, I can reach internet, as well as other systems on my LAN. When I switch to static, I have connections to my LAN, but can not get to internet, the DNS resolution is somehow not... (2 Replies)
Discussion started by: migurus
2 Replies

2. Programming

GDB problem accessing static variables in C

Hi, Can anyone explain this please..... This is on AIX with GDB (tried a few versions). It only happens when program compiled in 64 bit and only with static variables.... A simple test program... ### snip #include <stdio.h> main() { static int n; n = 6; printf("hello %d\n", n);... (0 Replies)
Discussion started by: bagpussnz
0 Replies

3. Debian

Program compile problem (glib pkg-config)

I need to compile a program which uses glib-2.0. I installed the package libglib2.0-0 but the configure script can't find it because the libglib package doesn't provide a .pc file which pkg-config looks for. How can I resolve this? Debian 6.0 (SPARC) (3 Replies)
Discussion started by: snorkack59
3 Replies

4. Programming

Problem with static compiling - GCC

Hi guys. I want to compile three files: gcc -static main.c fib.c fib.h it is pure C i mean i use standard C library. but it gives me this error: /usr/bin/ld: cannot find -lc collect2: ld returned 1 exit status what should i do? (4 Replies)
Discussion started by: majid.merkava
4 Replies

5. IP Networking

I need HELP to Set up Coyote Linux router with 1 static IP & 64 internal static IP

hello, i need help on setting my coyote linux, i've working on this for last 5 days, can't get it to work. I've been posting this message to coyote forum, and other linux forum, but haven't get any answer yet. Hope someone here can help me...... please see my attached picture first. ... (0 Replies)
Discussion started by: dlwoaud
0 Replies

6. Programming

Problem in static structure array in C

Hi, I have a following problem in C. I have a function A in which I used to call another function (function B) and pass an array of values through array variable by using below:- foo=functionB(array); In functionB, i used to just return some "values" (e.g return num;) in order to pass... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

7. HP-UX

Problem in HP-UX compiling

Hi When im trying to do make --version and make --help in HP-UX it throws error Make: Unknown flag argument -. Stop. a soft link is present in this directory /usr/bin/make and hard link is in /usr/ccs/bin/make what could be the reason can any1 ..please tell me how to solve this... (1 Reply)
Discussion started by: vasanthan
1 Replies

8. Programming

problem about using zlib to uncompress gzip in memory

I wrote a function which for uncompressing data for gzip or deflate format using zlib,see followed code; source param is pointed to the compressed data,len param is the size of compressed data, dest param is for returning the address which pointed to the uncompressed data;the last gzip param tell... (0 Replies)
Discussion started by: iwishfine
0 Replies

9. Solaris

Problem's compiling Glib

Hello, I am trying to install glib on my development box - with little/no luck. Below are some details of the box: SunOS 5.8 Generic_117350-38 sun4u sparc SUNW,Ultra-Enterprise gcc version 2.95.2 19991024 (release) GNU Make version 3.78.1, by Richard Stallman and Roland McGrath. Glib version:... (2 Replies)
Discussion started by: tetley
2 Replies

10. Solaris

Compiling problem

I'm trying to install the jed text editor on a SunOS 5.10 box. It depends on the s-lang library, which I installed to ~/lib. I'm trying to install jed to ~/jed (it's a box @ my university, so I don't have rights to install globally), but when I run make I get this error: It looks like it... (1 Reply)
Discussion started by: iandunn
1 Replies
Login or Register to Ask a Question