LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-24-2011, 08:13 AM   #1
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Rep: Reputation: Disabled
DBUS -> Expat.h is missing


Hello

I try to compile the dbus 1.4.16 and i get the following error during the configuration:

Code:
checking for accept4... yes
checking abstract socket namespace... no
checking for pkg-config... (cached) /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts
I installed expat successfully. The libraries are installed at the following directory:

Code:
/usr/local/lib/libexpat.so.1
/usr/local/lib/libexpat.so.1.5.2
/usr/local/lib/libexpat.so.0
/usr/local/lib/libexpat.so
the include path for expat.h is at:

Code:
/usr/local/include/expat.h
The library path is in the ld.so.conf file. I run ldconfig several times. The ld cache shows me that the libraries should be found.

I tried to run the configure with the following commands:
Code:
./configure --libdir=/usr/local/lib --includedir=/usr/local/include
but this has no effects. Can anybody give me further advices? Suggestions?

Greetings
 
Old 11-25-2011, 12:58 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by lfs_mm View Post
check config.log for failed attempts
What does config.log say?
 
Old 11-25-2011, 02:08 AM   #3
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Original Poster
Rep: Reputation: Disabled
The config.log has following entries:

Code:
.....
|
|   ;
|   return 0;
| }
configure:19074: result: no
configure:19160: checking for pkg-config
configure:19193: result: no
configure:19231: checking for XML_ParserCreate_MM in -lexpat
configure:19256: gcc -o conftest -g -O2   conftest.c -lexpat   >&5
/tools/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
configure:19256: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "dbus"
| #define PACKAGE_TARNAME "dbus"
| #define PACKAGE_VERSION "1.4.16"
| #define PACKAGE_STRING "dbus 1.4.16"
| #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=dbus"
| #define PACKAGE_URL ""
| #define PACKAGE "dbus"
| #define VERSION "1.4.16"

.....

checking sys/syslimits.h presence... no
checking for sys/syslimits.h... no
checking whether MSG_NOSIGNAL is declared... yes
checking for ISO C99 varargs macros in C... yes
checking for GNUC varargs macros... yes
checking for struct cmsgcred... no
checking for getpeerucred... no
checking for getpeereid... no
checking for pipe2... yes
checking for accept4... yes
checking abstract socket namespace... no
checking for pkg-config... no
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts
/sources/avahi/dbus-1.4.16 # vi config.log
|   listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
|
|   if (listen_fd < 0)
|     {
|       fprintf (stderr, "socket() failed: %s\n", strerror (errno));
|       exit (1);
|     }
|
|   memset (&addr, '\0', sizeof (addr));
|   addr.sun_family = AF_UNIX;
|   strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
|   /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
|    * beginning.
|    */
|   slen = SUN_LEN(&addr);
|   addr.sun_path[0] = '\0'; /* this is what makes it abstract */
|
|   if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
|     {
|        fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
|                 strerror (errno));
|        exit (1);
|     }
|   else
|     exit (0);
|
|   ;
|   return 0;
| }
configure:19074: result: no
configure:19160: checking for pkg-config
configure:19193: result: no
configure:19231: checking for XML_ParserCreate_MM in -lexpat
| extern "C"
| #endif
| char XML_ParserCreate_MM ();
| int
| main ()
| {
| return XML_ParserCreate_MM ();
|   ;
|   return 0;
| }
configure:19265: result: no
configure:19372: error: Could not find expat.h, check config.log for failed attempts

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_c_bigendian=no
ac_cv_c_compiler_gnu=yes
ac_cv_c_inline=inline
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
- config.log 2445/2984 81%
| extern "C"
| #endif
| char XML_ParserCreate_MM ();
| int
| main ()
| {
| return XML_ParserCreate_MM ();
|   ;
|   return 0;
| }
configure:19265: result: no
configure:19372: error: Could not find expat.h, check config.log for failed attempts

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_c_bigendian=no
ac_cv_c_compiler_gnu=yes
ac_cv_c_inline=inline
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
- config.log 2445/2984 81%
| extern "C"
| #endif
| char XML_ParserCreate_MM ();
| int
| main ()
| {
| return XML_ParserCreate_MM ();
|   ;
|   return 0;
| }
configure:19265: result: no
configure:19372: error: Could not find expat.h, check config.log for failed attempts

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_c_bigendian=no
ac_cv_c_compiler_gnu=yes
ac_cv_c_inline=inline
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DBUS_GLIB_CFLAGS_set=
ac_cv_env_DBUS_GLIB_CFLAGS_value=
/sources/avahi/dbus-1.4.16 # vi config.log
| #define HAVE_GNUC_VARARGS 1
| #define HAVE_PIPE2 1
| #define HAVE_ACCEPT4 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char XML_ParserCreate_MM ();
| int
| main ()
| {
| return XML_ParserCreate_MM ();
|   ;
|   return 0;
| }
configure:19265: result: no
configure:19372: error: Could not find expat.h, check config.log for failed attempts
Does that help ? Suggestions?
 
Old 11-25-2011, 02:47 AM   #4
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Original Poster
Rep: Reputation: Disabled
I think it is a general problem in my linux system that the expat library can not be found.
I did the following thing: In a test folder i created a dummy.c file with the following content:

Code:
#include "/usr/include/expat.h"

int main() {
        XML_Parser parser = XML_ParserCreate(NULL);
        return 0;
}
on the command line i tried the following:

Code:
/tests # gcc dummy.c -o dummy -lexpat
the output was the same as from dbus config log:

Code:
/tests # gcc dummy.c -o dummy -lexpat
/tools/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
Why does the linker not found the library? When i do a "ld-config -p | grep 'expat'" i receive the following:
Code:
/tests # ldconfig -p | grep 'expat'
        libexpat.so.1 (libc6) => /usr/lib/libexpat.so.1
        libexpat.so (libc6) => /usr/lib/libexpat.so
Should this not solve the problem?? What am I doing wrong?

Greetings
 
Old 11-25-2011, 03:02 AM   #5
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Original Poster
Rep: Reputation: Disabled
if i do

Code:
gcc dummy.c -o dummy -L/usr/local/lib -lexpat
then the compiler does not complain and the program was successfully compiled. What can I do about this problem? Why should the linker
not find -lexpat?

Greetings
 
Old 11-25-2011, 03:36 AM   #6
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Instead of --libdir and --includedir, try passing in the paths as make variables, e.g.

Code:
./configure LDFLAGS='-L/usr/local/lib' CFLAGS='-I/usr/local/include'
Or variations thereon.

Actually, that won't fix your configure error...

In your dummy.c, you are able to find the header, in /usr/include/ (NOT /usr/local/include), because that's where it normally lives. What happens when you modify it to /usr/local/include/expat.h ?

However, you have a link-time error without -L, because the compiler is trying to find libexpat in the wrong directory. You can add /usr/local/lib to the config files in /etc/ld.so.conf.d/, if you want to include that path in the library search without an explicit -L flag.

Last edited by jhwilliams; 11-25-2011 at 03:39 AM.
 
1 members found this post helpful.
Old 11-25-2011, 03:44 AM   #7
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thank you for your help. I could compile DBus successfully with the following commands:

Code:
export LDFLAGS=-Wl,-L/usr/local/lib,-lexpat
export CPPFLAGS=-I/usr/local/include
./configure
make
make install
It would be interesting why the compiler cannot explicitly find the -lexpat library. As I said, I have a entry in the ld.so.conf file for that and I run the ldconfig command. The ldconfig -p command shows also that the library is in the cache.
What other possibilities are there that the linker (ld) does find the library?

Greetings.
 
Old 11-25-2011, 03:53 AM   #8
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Oh yes, sorry - you did say that earlier (wrt ldconfig.)

Very strange, I'm just not sure. Quite honestly, though, I've run into enough broken configure scripts before that don't respect all of the flags. I wouldn't be surprised if it's just that.

I'm glad the variable exports is a functional workaround for now, at least!
 
Old 11-25-2011, 04:05 AM   #9
lfs_mm
Member
 
Registered: Nov 2011
Posts: 35

Original Poster
Rep: Reputation: Disabled
Ok I ignore that at the moment. Maybe it is the toolchain I am using on my embedded device which is running on a ATOM (Intel) architecture. I used the LFS 6.7 Book to compile a fully functional Toolchain. Then i copied this toolchain on the embedded device to compile several diffrent programs. For a webinterface i needed the PHP Zend compiler. Now i need the AVAHI libraries for the mDNS and DNS-SD services. It was a little bit a pain in the *peep* until i figured out how to use the toolchain in a such way. I didn't want to compile the whole gcc & libc stuff again on the embedded device. So for now it is a quite good way with the Toolchain from CHAPTER 5 (LFS BOOK).

Thank you for your help

Greetings
 
1 members found this post helpful.
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Core 9 update dbus.exception & dbus.proxies & DBus.Error.AccessDenied errors trien27 Fedora 1 12-08-2008 11:23 PM
Xfce4.4RC1 fails to build missing dbus ? exvor Linux - Software 2 10-02-2006 04:34 PM
libxml or Expat slzckboy Programming 0 12-25-2005 06:29 PM
Cannot login using X - something about missing file /usr/share/dbus-1/services Spiney Linux - General 2 05-02-2005 11:33 AM
expat!!! hhegab Linux - Software 6 07-20-2003 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:40 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