Having problems trying to compile arfperl plugin on RHEL AS 4 Linux
[EMAIL PROTECTED] arfperl]$ more Makefile
# Copyright (c) 2001 -2002 Peregrine Remedy, Inc.
# All rights reserved.
# Parameters.
PLUGIN = arfperl.so
OBJECTS = arfperl.o
PERL_ARCH = linux-i386
PERL_DIR = /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE
ARS_DIR = /u01/app/arsystem/api/include
RM = rm -f
# Compiler flags.
CC = gcc
CFLAGS = -D_GNU_SOURCE -g -fPIC -mno-align-double -shared
#CFLAGS = -g -fPIC -mno-align-double -shared -D_REENTRANT
-D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe
LDFLAGS = -shared
#
#CPPFLAGS = -I../../../include -I$(PERL_DIR) -I$(ARS_DIR)
CPPFLAGS = -I/usr/local/include -I/usr/include/gdbm -I../../../include
-I$(PERL_DIR) -I$(ARS_DIR)
LDLIBS = -lperl -lnsl -lw -lpthread
# Standard targets.
all: $(PLUGIN)
$(PLUGIN): $(OBJECTS)
$(CC) -o $(PLUGIN) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
clean:
$(RM) $(PLUGIN) $(OBJECTS) core
[EMAIL PROTECTED] arfperl]$ make clean
rm -f arfperl.so arfperl.o core
[EMAIL PROTECTED] arfperl]$ make
gcc -D_GNU_SOURCE -g -fPIC -mno-align-double -shared
-I/usr/local/include -I/usr/include/gdbm -I../../../include
-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE
-I/u01/app/arsystem/api/include -c -o arfperl.o arfperl.c
gcc -o arfperl.so arfperl.o -shared -lperl -lnsl -lw -lpthread
/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make: *** [arfperl.so] Error 1
Using:-
LD_LIBRARY_PATH=:/usr/lib/oracle/10.2.0.3/client/lib:/usr/java/jdk1.5.0_
13/jre/lib/i386/native_threads:/usr/lib64/perl5/5.8.5/x86_64-linux-threa
d-multi/CORE
[EMAIL PROTECTED] arfperl]$ ls -ltr
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE/lib*.so
-r-xr-xr-x 1 root root 1385848 Jul 24 2006
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE/libperl.so
[EMAIL PROTECTED] arfperl]$ file
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE/libperl.so
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE/libperl.so: ELF
64-bit LSB shared object, AMD x86-64, version 1 (SYSV), stripped
So if its complaining about the lack of a shared perl library in the
LD_LIBRARY_PATH i dont know why
----------------------- ld man page
-larchive
--library=archive
Add archive file archive to the list of files to link. This
option may be used any number of
times. ld will search its path-list for occurrences of
"libarchive.a" for every archive
specified.
On systems which support shared libraries, ld may also search
for libraries with extensions
other than ".a". Specifically, on ELF and SunOS systems,
ld will search a directory for a
library with an extension of ".so" before searching for one
with an extension of ".a". By
convention, a ".so" extension indicates a shared library.
The linker will search an archive only once, at the
location where it is specified on the
command line. If the archive defines a symbol which was
undefined in some object which
appeared before the archive on the command line, the
linker will include the appropriate
file(s) from the archive. However, an undefined symbol in an
object appearing later on the
command line will not cause the linker to search the archive
again.
See the -( option for a way to force the linker to search
archives multiple times.
You may list the same archive multiple times on the command
line.
This type of archive searching is standard for Unix linkers.
However, if you are using ld on
AIX, note that it is different from the behaviour of the AIX
linker.
------------------
When using -shared it looks for libperl.so. But its there
--------------------------------
So NOW: ---->
more Makefile
# Copyright (c) 2001 -2002 Peregrine Remedy, Inc.
# All rights reserved.
# Parameters.
PLUGIN = arfperl.so
OBJECTS = arfperl.o
PERL_ARCH = linux-i386
PERL_DIR = /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE
ARS_DIR = /u01/app/arsystem/api/include
RM = rm -f
# Compiler flags.
CC = gcc
CFLAGS = -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -fPIC
-fno-strict-aliasing -mno-align-double -shared
#CFLAGS = -g -fPIC -mno-align-double -shared -D_REENTRANT
-D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe
LDFLAGS = --verbose -t -shared
#
#CPPFLAGS = -I../../../include -I$(PERL_DIR) -I$(ARS_DIR)
CPPFLAGS = -I/usr/local/include -I/usr/include/gdbm -I../../../include
-I$(PERL_DIR) -I$(ARS_DIR)
LDLIBS = -lperl -lnsl -lw -lpthread
# Standard targets.
all: $(PLUGIN)
$(PLUGIN): $(OBJECTS)
$(CC) -o $(PLUGIN) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
clean:
$(RM) $(PLUGIN) $(OBJECTS) core
Gets me this --->
make
gcc -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -fPIC
-fno-strict-aliasing -mno-align-double -shared -I/usr/local/include
-I/usr/include/gdbm -I../../../include
-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE
-I/u01/app/arsystem/api/include -c -o arfperl.o arfperl.c
gcc -o arfperl.so arfperl.o --verbose -t -shared -lperl -lnsl -lw
-lpthread
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
/usr/libexec/gcc/x86_64-redhat-linux/3.4.6/collect2 --eh-frame-hdr -m
elf_x86_64 -shared -o arfperl.so -t
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtbeginS.o
-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6
-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6
-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64
-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../.. -L/lib/../lib64
-L/usr/lib/../lib64 arfperl.o -lperl -lnsl -lw -lpthread -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crtn.o
/usr/bin/ld: cannot find -lperl
/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtbeginS.o
arfperl.o
collect2: ld returned 1 exit status
make: *** [arfperl.so] Error 1
So it cant find the shared lib but its there - anyone got any pointers
Thanks
Simon
Simon Taylor
Service Tools Solutions (STS) Engineer
Nortel
Email [EMAIL PROTECTED]
Office +44.1279 402291 (ESN 6 742 2291)
Mobile +44.7740.533743 (ESN 748 3743)
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"