- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: gcc Static Compilation ld: errors
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 03:25 AM
тАО11-01-2007 03:25 AM
# make
No suffix list.
make all-recursive
No suffix list.
Making all in src
gcc -g -O2 -Wall -g -o syslog-ng main.o libsyslog-ng.a -static -lnsl -L/usr/local/lib -lglib-2.0 -lintl -liconv -L/usr/local/lib -levtlog
ld: Can't find library for -lglib-2.0
Fatal error.
collect2: ld returned 1 exit status
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
Installed Software
----------------------------------
binutils 2.15a
bison 2.3 bison
byacc 20040328 byacc
bzip2 1.0.4 bzip2
flex 2.5.4a flex
gawk 3.1.5 gawk
gettext 0.16 gettext
glib 1.2.10 glib
glib2 2.12.9 glib2
libgcc 4.2.1 libgcc
libiconv 1.11 libiconv
libpcap 0.9.5 libpcap
libtool 1.5.22 libtool
pkgconfig 0.21 pkgconfig
gcc path is as below:
# whereis gcc
gcc: /usr/local/lib/gcc /opt/hp-gcc64-4.1.2/bin/gcc /opt/hp-gcc64/bin/gcc /opt/hp-gcc64-4.1.2/man/man1/gcc.1 /opt/hp-gcc64/man/man1/gcc.1
#
System infor is as
------------------------------------------
System Hardware
Model: 9000/785/B2000
Main Memory: 512 MB
Processors: 1
OS mode: 64 bit
LAN hardware ID: 0x001083CF287A
Software ID: 2010978044
Keyboard Language: USB_PS2_DIN_US_English
****************************************************
Please help me how to solve this problem
Solved! Go to Solution.
- Tags:
- gcc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 04:02 AM
тАО11-01-2007 04:02 AM
Re: gcc Static Compilation ld: errors
What were you doing when you got them?
(Hint: "make" is not a sufficiently detailed
description.)
> ld: Can't find library for -lglib-2.0
Where is your "libglib-2.0.*"? Is it in "/usr/local/lib"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 04:06 AM
тАО11-01-2007 04:06 AM
Re: gcc Static Compilation ld: errors
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 04:18 AM
тАО11-01-2007 04:18 AM
Re: gcc Static Compilation ld: errors
Or even "ls -l /usr/local/lib/libglib*"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 04:24 AM
тАО11-01-2007 04:24 AM
Re: gcc Static Compilation ld: errors
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2007 09:19 PM
тАО11-01-2007 09:19 PM
Re: gcc Static Compilation ld: errors
the output of teh instructed command is as below:
# ls -la /usr/local/lib/libglib*
-rw-r--r-- 1 root sys 1044726 Feb 6 2007 /usr/local/lib/libglib-2.0.a
-rw-r--r-- 1 root sys 856 Feb 6 2007 /usr/local/lib/libglib-2.0.la
-r-xr-xr-x 1 root sys 1036288 Feb 6 2007 /usr/local/lib/libglib-2.0.sl
-rw-r--r-- 1 root sys 296556 Nov 27 2006 /usr/local/lib/libglib.a
-rw-r--r-- 1 root sys 666 Nov 27 2006 /usr/local/lib/libglib.la
-r-xr-xr-x 1 root sys 290816 Nov 27 2006 /usr/local/lib/libglib.sl
#
Regards
Shamim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-02-2007 04:49 PM
тАО11-02-2007 04:49 PM
Re: gcc Static Compilation ld: errors
Does it link if you remove -static?
I assume you aren't creating 64 bit executables?
(It seems you aren't using PA ld32.)
In fact, are you using a foreign devil linker? You must use HP's, which look like:
$ cc -Ae ~/hi.c -lxxxx
/usr/ccs/bin/ld: Can't find library: "xxxx"
$ cc -Ae ~/hi.c -lxxxx +DD64
ld: Can't find library or mismatched ABI for -lxxxx
What does file(1) show for:
$ file /usr/local/lib/libglib-2.0.a
$ file /usr/local/lib/libglib-2.0.sl
(These are the two files that ld(1) should find when using your -L and -lglib-2.0.)
- Tags:
- foreign devil tools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2007 10:24 PM
тАО11-04-2007 10:24 PM
Re: gcc Static Compilation ld: errors
/usr/local/lib/libglib-2.0.a: archive file -PA-RISC2.0 relocatable library
$ file /usr/local/lib/libglib-2.0.sl
/usr/local/lib/libglib-2.0.sl: PA-RISC2.0 shared library -not stripped
$
I'm using gcc downloaded from HP-UX(DSPP) website
(http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2a08725cc2f02110725cc2f02110275d6e10RCRD)
and it is available as
# whereis gcc
gcc: /usr/local/lib/gcc /opt/hp-gcc64-4.1.2/bin/gcc /opt/hp-gcc64/bin/gcc /opt/hp-gcc64-4.1.2/man/man1/gcc.1 /opt/hp-gcc64/man/man1/gcc.1
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 10:08 AM
тАО11-05-2007 10:08 AM
Re: gcc Static Compilation ld: errors
/usr/local/lib/libglib-2.0.a: archive file -PA-RISC2.0 relocatable library
$ file /usr/local/lib/libglib-2.0.sl
/usr/local/lib/libglib-2.0.sl: PA-RISC2.0 shared library -not stripped
These should work. But your gcc path has: hp-gcc64-4.1.2
This implies you are compiling for 64 bit and your libs aren't.
Do: file main.o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 05:51 PM
тАО11-05-2007 05:51 PM
Re: gcc Static Compilation ld: errors
However
# file ./src/main.o
./src/main.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
#
I'm still unable to compile.
Regards
Shamim