LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-13-2010, 02:54 AM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
libexpat problem


Hello,
I am getting some error when i compile cross compile "dbus-1.2.20".
error
Code:
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts
so i downloaded te expat library sources i cross compiled. But again i am getting same error. I think i have to add "-lexpat" in LDFLAG. But i dont know how to do that. Can anyone help me?
 
Old 02-13-2010, 05:30 AM   #2
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Rep: Reputation: 1
Here is what I did for expat-2.0.1 and dbus-1.2.16.

First, make sure you have pkg-config-0.23.

Next, setup for temporary pkg-config environment variables, I built it in a script so I pre-pended them with S_:
Code:
S_PKG_CONFIG_LIBDIR="${target}${XORG_PREFIX}/lib/pkgconfig:${target}/usr/lib/pkgconfig"  
S_PKG_CONFIG_PATH="${target}${XORG_PREFIX}/lib/pkgconfig:${target}/usr/lib/pkgconfig"  
S_PKG_CONFIG_SYSROOT_DIR="${target}"   
S_PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
S_PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
Replace target and XORG_PREFIX with values appropriate for your install.

Now prepend the ./configure command with the variables:
Code:
cd ${SOURCES}
tar -xzf dbus-1.2.16.tar.gz
cd dbus-1.2.16
PKG_CONFIG_LIBDIR=${S_PKG_CONFIG_LIBDIR} \
PKG_CONFIG_PATH=${S_PKG_CONFIG_PATH} \
PKG_CONFIG_SYSROOT=${S_PKG_CONFIG_SYSROOT} \
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=${PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} \
PKG_CONFIG_ALLOW_SYSTEM_LIBS=${PKG_CONFIG_ALLOW_SYSTEM_LIBS} \
./configure --prefix=/usr \
            --sysconfdir=/etc \
            --libexecdir=/usr/lib/dbus-1.0  \
            --localstatedir=/var &&
make &&
make DESTDIR=${target} install
I also found that for a lot of packages I had to delete the *.la library files:
Code:
find ${target} -name "*.la" -delete
This can be simplified by exporting the variables to the environment, but be careful about un-intended consequences for installing development system software.

Hope this helps.

Last edited by paulcsf; 02-13-2010 at 02:53 PM. Reason: added dbus un-tar to build commands
 
Old 02-13-2010, 06:07 AM   #3
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
I installed expat sucessfully. Again why the configuration file of dbus is saying this error. That is my question...?
 
Old 02-13-2010, 07:00 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The command :

nm -D /<path-to-cross-compiled>/libexpat.so

.. will show, if XML_ParserCreate_MM is present
in libexpat.so
.....

http://www.yolinux.com/TUTORIALS/Lib...ndDynamic.html
.....

Last edited by knudfl; 02-13-2010 at 07:53 AM.
 
Old 02-13-2010, 07:59 AM   #5
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Yes it is installed see
Code:
0000ba00 T XML_DefaultCurrent
000028d0 T XML_ErrorString
00002900 T XML_ExpatVersion
00002920 T XML_ExpatVersionInfo
00007b40 T XML_ExternalEntityParserCreate
00002850 T XML_FreeContentModel
00002250 T XML_GetBase
000032c0 T XML_GetBuffer
00002730 T XML_GetCurrentByteCount
00002710 T XML_GetCurrentByteIndex
00002800 T XML_GetCurrentColumnNumber
000027b0 T XML_GetCurrentLineNumber
00002700 T XML_GetErrorCode
00002940 T XML_GetFeatureList
00002270 T XML_GetIdAttributeIndex
00002760 T XML_GetInputContext
00003260 T XML_GetParsingStatus
00002260 T XML_GetSpecifiedAttributeCount
000028b0 T XML_MemFree
00002870 T XML_MemMalloc
00002890 T XML_MemRealloc
00003470 T XML_Parse
00002460 T XML_ParseBuffer
00006b50 T XML_ParserCreate
00006b30 T XML_ParserCreateNS
00006ad0 T XML_ParserCreate_MM
00005a10 T XML_ParserFree
00006b60 T XML_ParserReset
00002610 T XML_ResumeParser
00002410 T XML_SetAttlistDeclHandler
00007540 T XML_SetBase
000022e0 T XML_SetCdataSectionHandler
000022b0 T XML_SetCharacterDataHandler
000022d0 T XML_SetCommentHandler
00002310 T XML_SetDefaultHandler
00002320 T XML_SetDefaultHandlerExpand
00002330 T XML_SetDoctypeDeclHandler
00002400 T XML_SetElementDeclHandler
00002280 T XML_SetElementHandler
00007a80 T XML_SetEncoding
00002300 T XML_SetEndCdataSectionHandler
00002350 T XML_SetEndDoctypeDeclHandler
000022a0 T XML_SetEndElementHandler
000023a0 T XML_SetEndNamespaceDeclHandler
00002420 T XML_SetEntityDeclHandler
000023c0 T XML_SetExternalEntityRefHandler
000023d0 T XML_SetExternalEntityRefHandlerArg
00002380 T XML_SetNamespaceDeclHandler
000023b0 T XML_SetNotStandaloneHandler
00002370 T XML_SetNotationDeclHandler
00002440 T XML_SetParamEntityParsing
000022c0 T XML_SetProcessingInstructionHandler
00002210 T XML_SetReturnNSTriplet
000023e0 T XML_SetSkippedEntityHandler
000022f0 T XML_SetStartCdataSectionHandler
00002340 T XML_SetStartDoctypeDeclHandler
00002290 T XML_SetStartElementHandler
00002390 T XML_SetStartNamespaceDeclHandler
000023f0 T XML_SetUnknownEncodingHandler
00002360 T XML_SetUnparsedEntityDeclHandler
00002230 T XML_SetUserData
00002430 T XML_SetXmlDeclHandler
00002580 T XML_StopParser
000021e0 T XML_UseForeignDTD
000021d0 T XML_UseParserAsHandlerArg
00021300 T XmlGetUtf16InternalEncoding
000213f0 T XmlGetUtf16InternalEncodingNS
000212e0 T XmlGetUtf8InternalEncoding
000213c0 T XmlGetUtf8InternalEncodingNS
00021770 T XmlInitEncoding
00021880 T XmlInitEncodingNS
00020c30 T XmlInitUnknownEncoding
00021630 T XmlInitUnknownEncodingNS
000221e0 T XmlParseXmlDecl
00022260 T XmlParseXmlDeclNS
00027830 T XmlPrologStateInit
00027870 T XmlPrologStateInitExternalEntity
000207e0 T XmlSizeOfUnknownEncoding
00020780 T XmlUtf16Encode
00020690 T XmlUtf8Encode
         w _Jv_RegisterClasses
         U __aeabi_unwind_cpp_pr0
         U __aeabi_unwind_cpp_pr1
         U __assert_fail
00032994 A __bss_end__
00032990 A __bss_start
00032990 A __bss_start__
         w __cxa_finalize
0003298c D __data_start
00032994 A __end__
00029298 A __exidx_end
00028d08 A __exidx_start
         w __gmon_start__
00032994 A _bss_end__
00032990 A _edata
00032994 A _end
00027a10 T _fini
00002000 T _init
         U free
         U malloc
         U memcmp
         U memcpy
         U memmove
         U memset
         U realloc
sharief@sharief-desktop:/mnt/omap/sources/fontconfig-2.8.0$
Please help
 
Old 02-13-2010, 03:16 PM   #6
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Rep: Reputation: 1
I am sorry, expat doesn't install a pkg-config file. So the above directions may help with other packages, it won't for expat.

Here is the rest of what I used which allows dbus to install in the cross compiled system.

Here is what expat looks like in my system (this is much later in my build, the firefox versions probably aren't present in yours):
Code:
>> find ${target} -name "*expat*"
${target}/usr/include/expat.h
${target}/usr/include/firefox-2.0.0.15/expat
${target}/usr/include/firefox-2.0.0.15/expat/expat.h
${target}/usr/include/firefox-2.0.0.15/expat/expat_config.h
${target}/usr/include/expat_external.h
${target}/usr/share/doc/libxml2-2.6.31/html/tutorial/includexpath.c
${target}/usr/lib/libexpat.so.1
${target}/usr/lib/libexpat.so
${target}/usr/lib/libexpat.a
${target}/usr/lib/libexpat.so.1.5.2
For building dbus, I have the following for CFLAGS and LDFLAGS:
Code:
>> echo $CFLAGS
-O2 -march=i586 -fomit-frame-pointer -s -I${target}${XORG_PREFIX}/include -I${target}${XORG_PREFIX}/include/xorg -I${target}${XORG_PREFIX}/include/X11 -I${target}/usr/include/X11 -I${target}/usr/include -I/usr/include/c++/4.2.4/i586-pc-linux-gnu -I/tools/lib/gcc/i586-pc-linux-gnu/4.2.4/include

>> echo $LDFLAGS
-s -L${target}${XORG_PREFIX}/lib -Wl,--rpath -Wl,${target}${XORG_PREFIX}/lib -L${target}/usr/lib -Wl,--rpath -Wl,${target}/usr/lib
So, the compiler has include paths which contain expat.h and the linker has paths which contain libexpat.so. I have marked the particular paths above in bold. I found this was the only way to get most packages to compile, as individually adding configure override flags quickly got out of hand, and a number of configure scripts only partially support their override flags.

Also note that the ${target} locations are first in CFLAGS. If you have to include build system include locations as I did, they should be last. The compiler searches through the include paths until it finds the desired file, so if there are multiple copies, the first location found is the version used.
 
Old 02-14-2010, 11:45 PM   #7
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
see if i give export command in my script and when i run i am getting the error
This is what i gave
Code:
export CFLAGS=$CFLAGS:/usr/include/
export LDFLAGS=$LDFLAGS:/usr/lib/
when i run i got this error
Code:
configure: WARNING: unrecognized options: --without-python
configure: creating cache cache-file
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin//install -c
checking whether build environment is sane... yes
checking for arm-linux-gnu-strip... arm-none-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin//mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-linux-gnu-gcc... arm-none-linux-gnueabi-gcc
checking for C compiler default output file name... 
configure: error: in `/mnt/omap/sources/dbus-1.2.20':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Configuration of glib library  has failed
don't know what to do. This is happening when i export LDFLAGS. if i didn't give that it is working fine and showing expat error at last. So confused. Please help me.
I am getting this error again even i give the host system expat.h path. what to do now?

Last edited by shariefbe; 02-14-2010 at 11:49 PM.
 
Old 02-15-2010, 08:26 AM   #8
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
i am struggling from last 2 days with this error. can anyone help me
 
Old 02-18-2010, 03:36 AM   #9
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Rep: Reputation: 1
You are confusing the PATH syntax with CFLAGS syntax.

PATH uses a syntax:
PATH=/dir1/subdir1:/dir2/:/dir3/subdir3

CFLAGS uses a syntax:
CFLAGS="-O2 -march=i586 -fomit-frame-pointer -s -I/dir1/subdir1 -I/dir2 -I/dir3/subdir3"

LDFLAGS uses a similar syntax to CFLAGS, except that -L/dir1/subdir1 -llib is used, -L and a path, -l and a library.

Notice the quotes which are required when the environment variable contains spaces. As I understand it, if you use double quotes " $VAR and ${VAR} will be expanded inside the string. If you use single quotes ' then $VAR and ${VAR} will not be expanded. Generally you want to use double quotes.

So if you want to append a path to CFLAGS, then export it, try this:
export CFLAGS="${CFLAGS} -I/usr/include"
export LDFLAGS="${LDFLAGS} -L/usr/lib -lexpat"

Hope this helps,
 
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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
libexpat.so.1 not found answerme Linux - Newbie 3 03-19-2012 08:05 PM
libexpat.so.1 yannifan Linux - General 2 02-28-2007 03:00 AM
libexpat.so.0 for openSUSE 10.2 Aleksandersen Linux - General 2 02-25-2007 04:51 PM
I should find libexpat.so.1 but I can't ozumsafa Linux - Software 1 12-21-2006 04:56 AM
where i can download libexpat.so.1 icoming Linux - Software 3 10-03-2006 09:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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