LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Issue trying to compile libXres (https://www.linuxquestions.org/questions/linux-software-2/issue-trying-to-compile-libxres-4175655880/)

coltson 06-17-2019 09:01 AM

Issue trying to compile libXres
 
I recently tried to build libXres from the source and I am encountering issues when trying to build from two different manners.

In the first I run the configure script with:

Code:

./configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/ PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/X11-1.6.7/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Xorgproto-2018.1/share/pkgconfig/:/media/34GB/Arqui
Then I run make, which causes:

Quote:


make[2]: Entering directory /media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0/src'
CC XRes.lo
XRes.c:9:25: error: X11/Xlibint.h: No such file or directory
XRes.c:10:23: error: X11/Xutil.h: No such file or directory
In file included from XRes.c:11:
/media/34GB/Arquivos-de-Programas-Linux/Xext-1.3.3/include/X11/extensions/Xext.h:34: error: expected ‘)’ before ‘*’ token
..............
In file included from XRes.c:12:
/media/34GB/Arquivos-de-Programas-Linux/Xext-1.3.3/include/X11/extensions/extutil.h:46: error: expected specifier-qualifier-list before ‘Display’
/media/34GB/Arquivos-de-Programas-Linux/Xext-1.3.3/include/X11/extensions/extutil.h:59: error: expected ‘)’ before ‘*’ token
.........
.........
In file included from XRes.c:13:
/media/34GB/Arquivos-de-Programas-Linux/Xorgproto-2018.1/include/X11/extensions/XResproto.h:28: error: expected specifier-qualifier-list before ‘CARD32’
error: expected specifier-qualifier-list before ‘CARD8’
...........
/XResproto.h:213: error: expected specifier-qualifier-list before ‘CARD8’
In file included from XRes.c:14:
../include/X11/extensions/XRes.h:13: error: expected specifier-qualifier-list before ‘XID’
../include/X11/extensions/XRes.h:18: error: expected specifier-qualifier-list before ‘Atom’
.............
../include/X11/extensions/XRes.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XResQueryExtension’
............
‘XResQueryResourceBytes’
XRes.c:25: error: expected ‘)’ before ‘*’ token
XRes.c:28: warning: excess elements in struct initializer
...........
XRes.c:34: error: ‘close_display’ undeclared here (not in a function)
XRes.c:34: warning: excess elements in struct initializer
.......
XRes.c:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XResQueryExtension’
.........
XRes.c: In function ‘XResGetClientIdType’:
.........
XRes.c:334: error: ‘Bool’ undeclared (first use in this function)
XRes.c: In function ‘XResGetClientPid’:
XRes.c:352: error: ‘XResClientIdSpec’ has no member named ‘mask’
XRes.c:353: error: ‘CARD32’ undeclared (first use in this function)
XRes.c:353: error: expected expression before ‘)’ token
XRes.c: At top level:
XRes.c:359: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ReadResourceSizeSpec’
............
make[2]: *** [XRes.lo] Error 1
make[2]: Leaving directory/media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory `/media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0' make: * [all] Error 2
The many ......... were introduced to make shorter the error message.

The strange thing is that Xlibint.h: and XUtil.h are present in the aforementioned X11 dir. So I don't know what is causing the problem. Perhaps an error on x11.pc ? It seems normal for me and it did work with most of the other X libraries.

I had a similar issue with libXext and so decided to try the same approach that I used with it. Deleted the current libXrender dir, unpacked the bziped libXres file and after running the above configure command, also typed:

Code:

export LDFLAGS=-L/media/34GB/Arquivos-de-Programas-Linux/X11-1.6.7/lib
Code:

export CPPFLAGS=-I/media/34GB/Arquivos-de-Programas-Linux/X11-1.6.7/include/
This time, instead a perfect compilation, I received:

Quote:

make[2]: Entering directory /media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0/src'
CC XRes.lo
CCLD libXRes.la
libtool: warning: library '/media/34GB/Arquivos-de-Programas-Linux/X11-1.6.7/lib//libX11.la' was moved.
/bin/grep: /media/34GB/Arquivos-de-Programas-Linux/X11-1.2.1/lib/libX11.la: No such file or directory
/bin/sed: can't read /media/34GB/Arquivos-de-Programas-Linux/X11-1.2.1/lib/libX11.la: No such file or directory
libtool: error: '/media/34GB/Arquivos-de-Programas-Linux/X11-1.2.1/lib/libX11.la' is not a valid libtool archive
make[2]: *** [libXRes.la] Error 1
make[2]: Leaving directory/media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory `/media/34GB/Arquivos-de-Programas-Linux/libXres-1.2.0' make: * [all] Error 2
From this link: https://stackoverflow.com/questions/...talled-library I followed a suggestion of recreating configure and Makefile.in through

Code:

make distclean //clean up all the previous generated files
autoconf //or autoreconf to generate configure script from configure.ac and configure.in
automake //to generate new Makefile.in from Makefile.ac
./configure //to generate new Makefile and libtool

However, I executed all the four above steps and it did not change the outcome. I will appreciate any suggestions of how solve the above compilation problems. Many Thanks.

MensaWater 06-17-2019 10:06 AM

Did you examine the output of the "configure" command before trying the "make". The "configure" is usually quite verbose and also usually puts a log there. It will give many WARNINGs which usually can be ignored but any errors or failures need to be addressed. It is only after you've addressed those that you should rerun the "configure" then the "make".

Sometimes it is simple things such as the configure looks for libblah.so.2 but you you have libblah.so.4 - often you can solve that by making a symbolic link of libblah.so.4 to libblah.so.2. The configure finds the link and knows to use your newer version.

Other times it may be you don't have the library or some other dependency and need to install that first.

coltson 06-20-2019 03:34 PM

Quote:

Originally Posted by MensaWater (Post 6006328)
Did you examine the output of the "configure" command before trying the "make". The "configure" is usually quite verbose and also usually puts a log there. It will give many WARNINGs which usually can be ignored but any errors or failures need to be addressed. It is only after you've addressed those that you should rerun the "configure" then the "make".

Sometimes it is simple things such as the configure looks for libblah.so.2 but you you have libblah.so.4 - often you can solve that by making a symbolic link of libblah.so.4 to libblah.so.2. The configure finds the link and knows to use your newer version.

Other times it may be you don't have the library or some other dependency and need to install that first.

It didn't say much, but this here might be important:
Quote:

Package xorg-macros was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-macros.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-macros' found
There is only one libX11.la that is in the expected /media.../X11/lib dir.

*********EDITED******

The libtools errors were because I was pointing the wrong directory (X11/include when it shall be X11/include/X11). However doing so, the first error remains.

*********EDITED2******

Created sym links to these two files
Code:

.../X11-1.6.7/include/X11/Xutil.h
and
Code:

.../X11-1.6.7/include/X11/Xlibint.h
to /usr/local/include. It didn't work.

MensaWater 06-21-2019 07:44 AM

Configure is telling you about a missing package.

This link has a solution for the same message that may work for you.

coltson 06-23-2019 12:21 PM

Quote:

Originally Posted by MensaWater (Post 6007693)
Configure is telling you about a missing package.

This link has a solution for the same message that may work for you.

Well, I installed Util-marcros 1.19.2 that contains xorg macros and it did not change anything.

MensaWater 06-24-2019 08:07 AM

Quote:

Originally Posted by coltson (Post 6008255)
Well, I installed Util-marcros 1.19.2 that contains xorg macros and it did not change anything.

So when you reran configure after installing that you still got:
Quote:

Package xorg-macros was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-macros.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-macros' found
If so you'd want to do as it suggests and modify the PKG_CONFIG_PATH environment variable.

coltson 06-26-2019 02:07 PM

Quote:

Originally Posted by MensaWater (Post 6008471)
So when you reran configure after installing that you still got:


If so you'd want to do as it suggests and modify the PKG_CONFIG_PATH environment variable.

Sorry, I did not explained myself well, the xorg-macros message vanished, what I meant was that the result of make continued to be the same.

However I was able to detect the source of the problems with libXres and libXext. The line
Quote:

prefix=/media/34GB/Arquivos-de-Programas-Linux/X11-1.2.1
on the x11.pc file had to be
Quote:

prefix=/media/34GB/Arquivos-de-Programas-Linux/X11-1.6.7
. I changed the dir name and was able to solve it then. Anyway, in the end I didn't need libXres (neither libXext) and hence xorg-macros, just needed libXrender and libXft


All times are GMT -5. The time now is 12:18 PM.