LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2019, 09:26 PM   #1
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
GLIB, GCC, dpkg, pkg-config, bluez cross-compile env questions thread


I need to specify PKG_CONFIG_PATH to Glib package.


EDITED

yes - whereis works just fine

still like to know why I am getting conflicting info

END OF EDIT




I do not know how to find such path , however , I am also getting conflicting info about the Glib-2.0 package.

Could somebody help me in specifying / finding the package path and also explain to me why I am getting conflicting info about the package?

Will appreciate help very much.

Code:
jim@jim-desktop:~$ pkg-config --list-all | grep glib
glib-sharp-2.0                 GLib - GLib
spice-client-glib-2.0          spice-client-glib-2.0 - SPICE Client GLib 2.0 library
glib-2.0                       GLib - C Utility Library exists here 
dbus-sharp-glib-2.0            Managed DBus GLib integration - GLib integration for dbus-sharp, the D-Bus IPC library
gio-unix-2.0                   GIO unix specific APIs - unix specific headers for glib I/O library
glibmm-2.4                     glibmm - C++ wrapper for GLib
gio-2.0                        GIO - glib I/O library


jim@jim-desktop:~$ dpkg -l "glib*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  glib-networkin 2.48.2-1~ubu amd64        network-related giomodules for GL
ii  glib-networkin 2.48.2-1~ubu all          network-related giomodules for GL
ii  glib-networkin 2.48.2-1~ubu amd64        network-related giomodules for GL
un  glibc-doc      <none>       <none>       (no description available)

no glib-2.0 detected here 
jim@jim-desktop:~$

Last edited by astrogeek; 05-11-2019 at 02:23 PM.
 
Old 05-05-2019, 11:33 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Use strace to find out:
Code:
$ strace pkg-config --cflags glib-2.0 2>&1 | grep 'open.*glib-2.0.pc' 
open("/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc", O_RDONLY) = 3
then dpkg -S to determine the package
Code:
$ dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
libglib2.0-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
Note dpkg -l trends to truncate the package-names, unless you trick it:
Code:
COLUMNS=2000 dpkg -l '*glib*' | cut -b1-40

Last edited by NevemTeve; 05-05-2019 at 11:36 PM.
 
1 members found this post helpful.
Old 05-06-2019, 07:52 AM   #3
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by NevemTeve View Post
Use strace to find out:
Code:
$ strace pkg-config --cflags glib-2.0 2>&1 | grep 'open.*glib-2.0.pc' 
open("/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc", O_RDONLY) = 3
then dpkg -S to determine the package
Code:
$ dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
libglib2.0-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
Note dpkg -l trends to truncate the package-names, unless you trick it:
Code:
COLUMNS=2000 dpkg -l '*glib*' | cut -b1-40
Thanks very much for reply.
I followed your suggestions and "found" glib-2.0.pc in same path.

I must be missing something since I am still getting stuff like this

Code:
jim@jim-desktop:~$ sudo dpkg -p 'glib-2.0'
dpkg-query: package 'glib-2.0' is not available
At this point I feel it would be the best to "reinstall" - I had success doing so for "pkg-config".
( I am still not sure why I am having these issues - most likely "user error.)

I am still having trouble understanding the relations between "package name" and "installing " all these "x-dev" libraries.

I did add the /usr/lib/x86_64-linux-gnu/pkgconfig path to the "configure" options, but due to the above it still fails.


Many thanks for your help, appreciate it.
 
Old 05-06-2019, 08:21 AM   #4
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Good and bad news
Found #1 nemesis of programming - typo!
SPACE before the closing " !

Code:
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig "
Typo makes sense, but still do not get how "configure" verifies "GLIB" without dpkg finding it.
I could post PART of the successful log if anybody likes to see it. Perhaps the answer in there somewhere.
 
Old 05-06-2019, 08:40 AM   #5
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Update
I have clean "configure" script run.
Now mowing to "make" and as expected having my first "make" error.
Should I post it here as continuum or make a new thread?
It is related to "glib"
 
Old 05-06-2019, 11:09 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
(Luckily the topic-title is broad enough.)
 
Old 05-06-2019, 11:48 AM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Quote:
Originally Posted by AnneRanch View Post
Should I post it here as continuum or make a new thread?
It is related to "glib"
Yes, here please.
 
Old 05-06-2019, 12:57 PM   #8
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Thanks for the permission.

Here is the full error output from "make".
It does no show up until the --host option is specified in "configure".

That according to SOME comments should be enough to specify "crosscompiling" - which is my objective.

I just run into unexpected errors when I added "echo" to the wrapper, so it is getting harder to "trace" part of suspected error code.

But these are header files so it may not be that hard.

It looks it may have something to do with 64 bits system, but that is just my first guess.


Code:
jim@jim-desktop:/media/jim/DEV/BLUEZ/BLUEZ_RPI/bluez-5.50$ sudo make
make --no-print-directory all-am
  CC       lib/bluetooth.lo
  CC       lib/hci.lo
  CC       lib/sdp.lo
  CCLD     lib/libbluetooth.la
  CC       lib/uuid.lo
  CCLD     lib/libbluetooth-internal.la
arm-linux-gnueabihf-ar: `u' modifier ignored since `D' is the default (see `U')
  CC       gdbus/mainloop.lo
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from gdbus/mainloop.c:28:
/usr/include/glib-2.0/glib/gtypes.h: In function '_GLIB_CHECKED_ADD_U64':
/usr/include/glib-2.0/glib/gmacros.h:232:53: error: size of array '_GStaticAssertCompileTimeAssertion_0' is negative
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
/usr/include/glib-2.0/glib/gmacros.h:229:47: note: in definition of macro 'G_PASTE_ARGS'
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^
/usr/include/glib-2.0/glib/gmacros.h:232:44: note: in expansion of macro 'G_PASTE'
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                            ^
/usr/include/glib-2.0/glib/gtypes.h:422:3: note: in expansion of macro 'G_STATIC_ASSERT'
   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
   ^
Makefile:5858: recipe for target 'gdbus/mainloop.lo' failed
make[1]: *** [gdbus/mainloop.lo] Error 1
Makefile:3278: recipe for target 'all' failed
make: *** [all] Error 2
jim@jim-desktop:/media/jim/DEV/BLUEZ/BLUEZ_RPI/bluez-5.50$
 
Old 05-06-2019, 01:41 PM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
You might want to quote the configure command you used before make.

Note: if I were to cross-compile programs on Debian(ish) platform, I would start here: https://wiki.debian.org/Multiarch/HOWTO

Last edited by NevemTeve; 05-06-2019 at 02:44 PM.
 
2 members found this post helpful.
Old 05-06-2019, 02:30 PM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,677
Blog Entries: 19

Rep: Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490
One or two remarks that might help you:

Most distros (certainly all the Debian-based ones) install a library in two parts. There is the library itself (which is needed by any running program that has been built against it) and the so-called "development package" consisting of compilation headers and documentation. This is only needed if you want to build an application which uses that library. The division goes back to the days of dial-up connections, when it saved mightily on download times. There was no need for people to download the headers if they weren't going to build anything locally.

Configure scripts are looking for headers, not library code. So when configure tells you that it can't find libfoo, it means it can't find the libfoo headers in /usr/include. The solution is to install the development package libfoo-dev.

Last edited by hazel; 05-06-2019 at 02:31 PM.
 
2 members found this post helpful.
Old 05-06-2019, 04:49 PM   #11
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by AnneRanch View Post
Typo makes sense, but still do not get how "configure" verifies "GLIB" without dpkg finding it.
Try checking the package called libglib2.0-dev in dpkg.

https://packages.debian.org/search?s...ds=glib-2.0.pc
 
2 members found this post helpful.
Old 05-06-2019, 06:36 PM   #12
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by hazel View Post
One or two remarks that might help you:

Most distros (certainly all the Debian-based ones) install a library in two parts. There is the library itself (which is needed by any running program that has been built against it) and the so-called "development package" consisting of compilation headers and documentation. This is only needed if you want to build an application which uses that library. The division goes back to the days of dial-up connections, when it saved mightily on download times. There was no need for people to download the headers if they weren't going to build anything locally.

Configure scripts are looking for headers, not library code. So when configure tells you that it can't find libfoo, it means it can't find the libfoo headers in /usr/include. The solution is to install the development package libfoo-dev.
This is needed very useful info, thanks.

When I started analysing the ":configure" script I looked at this correct output

Code:
@line 1898 DEBUG Checking for linux/if_alg.h... yes
@line 13221 DEBUG Checking for GLIB... yes
@line 13374 DEBUG Checking for DBUS... yes
@line 13453 DEBUG Checking D-Bus configuration directory... PKG_CONFIG_DEBUG_SPEW variable enabling debug spew

Only AFTER there is ANY problems with "Checking for GLIB" I get more info, but in general the error would be in style "...cannot find GLIB > 2.43" .
The bottom line - I have no idea "configure" is actually looking for "lib*" or "C" header or else.

I generally get more info after adding PKG_CONFIG_DEBUG_SPEW and after I get into habit of checking "config.log".

My approach may look silly, but I find it useful to try something and ONLY after it does not work as expected I "hit the books" or forums.

If I do it the other way around - I would never complete any project , and it is doubtful I would retain the "books knowledge" on something which works just fine.

I may not present myself as such , but "doing" computers since 197x I believe I do have reasonable base to build on.


Enough venting.
 
Old 05-06-2019, 06:38 PM   #13
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by ntubski View Post
Try checking the package called libglib2.0-dev in dpkg.

https://packages.debian.org/search?s...ds=glib-2.0.pc
I did similar - try to install "*-dev" only to get "you have the latest on your system ".
 
Old 05-06-2019, 07:30 PM   #14
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by NevemTeve View Post
You might want to quote the configure command you used before make.

Note: if I were to cross-compile programs on Debian(ish) platform, I would start here: https://wiki.debian.org/Multiarch/HOWTO
These are VERY basic options , just adding --host option causes the "make" output the error.

Code:
$ sudo ./configure_56 PKG_CONFIG_DEBUG_SPEW=set --host=arm-linux-gnueabihf
 
Old 05-07-2019, 07:50 AM   #15
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by NevemTeve View Post
You might want to quote the configure command you used before make.

Note: if I were to cross-compile programs on Debian(ish) platform, I would start here: https://wiki.debian.org/Multiarch/HOWTO
Good reference article, however, not totally applicable to what I am doing.

I do not want to restart another pointless discussion about reposting stuff, not explaining (in details) what I am doing and not appreciating group suggestions.

I do not need to build / install bluez package for ARM architecture package on my X86.
Bluetooth is part of the kernel, no need to do that.

What I have been after ,since I started discussing the project here, is to build bluetooth "C" library for ARM architecture on my X86 system.

That is what "configure" does , or should.

Optioning "configure" to build such "C" library for native, X86, architecture is NON ISSUE.
The issue is to do same for ARM , host, architecture and until I have such "C" library build by "configure" process - it is going to be an UNSOLVED issue.

Despite some misgivings about this forum. I DO APPRECIATE ALL SUGGESTIONS.

IT IS VERY HELPFUL TO BE ABLE TO BOUNCE OFF IDEAS IN FORUM. and not necessarily just having "SOLUTIONS".

Cheers

End of vent
 
  


Reply

Tags
dpkg, glib



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
conflicting glib versions and glib-config scius Linux - Software 5 06-03-2008 02:35 AM
[GLIB] Problems Installing GLIB ThA_eLMo_GoD Linux - Newbie 2 09-04-2004 05:27 PM
can't install gtk 2.4.4: "Requested 'glib-2.0 >= 2.4.0' but version of GLib is 2.2.3 webazoid Linux - Software 0 07-15-2004 06:07 PM
Compiling GAIM says i need GLib 2.0, yet i have GLib 2.4 MadSkillzMan Linux - Newbie 3 07-10-2004 04:10 AM
Problems relating to glib 1.2.10 and glib 1.2.9 p3ngu!n Mandriva 10 05-23-2004 09:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration