03-16-2006
I have made few changes in test program. Added errorno and dlerror() just for error checking
Quote:
$
$ cat testjvm2.c
#include <stdio.h>
#include <errno.h>
#include <dlfcn.h>
void main(void)
{
void *handle;
handle = dlopen("libjvm.so", RTLD_LAZY);
if( handle == NULL )
{
printf("errno[%d], errmsg[%s]\n", errno, dlerror());
return;
}
else
{
printf("\nJVM loaded successfully");
}
dlclose(handle);
}
$
when I compile the program I get error
Quote:
$ cc -o testjvm2 testjvm2.c
Undefined first referenced
symbol in file
dlopen testjvm2.o (symbol belongs to implicit dependency /usr/lib/libdl.so.1)
dlclose testjvm2.o (symbol belongs to implicit dependency /usr/lib/libdl.so.1)
dlerror testjvm2.o (symbol belongs to implicit dependency /usr/lib/libdl.so.1)
ld: fatal: Symbol referencing errors. No output written to testjvm2
$
Quote:
$ uname -a
SunOS snvi003 5.8 Generic_117350-20 sun4u sparc SUNW,Sun-Fire-V240
$
any pointers why the linking error?
-Ashish
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I compile my c program and get following result
hrnpfc01.c:1387: stray '\' in program
hrnpfc01.c:1387: parse error before `,'
hrnpfc01.c:1388: stray '\' in program
hrnpfc01.c:1388: parse error before `,'
hrnpfc01.c:1396: stray '\' in program
hrnpfc01.c:1396: parse error before... (4 Replies)
Discussion started by: zico
4 Replies
2. Programming
when i try to run an executable i got the following error message:
resolve_symbols: loader error: dlopen:
what does this error mean and what should be done to avoid this?
with regards (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies
3. Programming
Dear All
I have a program writen in C and test in Unix. Now, I am try to run this program in windows 2000. I am receiving an error ]_getopt is not define. I will appreciate if any one can help explain to me why this problem is hapening and to slove this problem.
Thank you (9 Replies)
Discussion started by: coulio
9 Replies
4. Programming
i was trying to compile a c program and got the error below. i need help on how to resolve this
$ make -ef putput
`if ; then echo getinf.awk ; else echo getora.awk;fi` EI.sql
`if ; then echo esql -static ; else echo esqlo8i;fi` -O -I. -c EI`if ; then echo .ec; else echo... (4 Replies)
Discussion started by: putput
4 Replies
5. Programming
hello can anyone help? :confused:
i make a C code in FreeBSD 5.4 and it succeed to run
the program requires connection to mysql server
when i try to compile it under solaris i get this error message
ld: fatal: file ./lib/libmysqlclient.so: wrong ELF machine type: EM_386
why? and how to... (3 Replies)
Discussion started by: kuampang
3 Replies
6. Programming
//foo.c
#include<stdio.h>
int pen(int a)
{
printf("%d",a);
}
$cc -c foo.c
$ls -shared -o libfoo.so foo.o
///////////now libfoo.so formed
//i have already designed libfoo.so
//main.c
#include<stdio.h>
#include <dlfcn.h>
int main()
{ (2 Replies)
Discussion started by: lookforlohith
2 Replies
7. Solaris
Hello!
I am trying install samba 3.5.4. and following this instruction from the source package.
So, there are my steps:
1 cd ../samba-3.5.4/source3
2 ./configure (without any arguments)
and when i run make it returns error
....................................................
Compiling... (2 Replies)
Discussion started by: zhum
2 Replies
8. UNIX for Dummies Questions & Answers
I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies
9. Ubuntu
Hi
I'm compiling a real-time kernel in linux, but after I type make bzImage things end with this:
(Things going well doing CC and things)....
CC arch/x86/kernel/kgdb.o
CC arch/x86/kernel/vm86_32.o
CC arch/x86/kernel/early_printk.o
CC arch/x86/kernel/ipipe.o... (2 Replies)
Discussion started by: mdop
2 Replies
10. Slackware
Tryng to compile nfs-utils to latest packages but..
make: Entering directory `/tmp/nfs-utils-1.2.8/utils/gssd'
/bin/sh ../../libtool --tag=CC --mode=link gcc -Wall -Wextra -Wstrict-prototypes -pipe -O2 -fPIC -I/usr/kerberos/include -I/usr/kerberos/include -O2 -fPIC -ltirpc -o gssd... (4 Replies)
Discussion started by: Linusolaradm1
4 Replies
LEARN ABOUT OPENDARWIN
dlerror
DLERROR(3) Linux Programmer's Manual DLERROR(3)
NAME
dlerror - obtain error diagnostic for functions in the dlopen API
SYNOPSIS
#include <dlfcn.h>
char *dlerror(void);
Link with -ldl.
DESCRIPTION
The dlerror() function returns a human-readable, null-terminated string describing the most recent error that occurred from a call to one
of the functions in the dlopen API since the last call to dlerror(). The returned string does not include a trailing newline.
dlerror() returns NULL if no errors have occurred since initialization or since it was last called.
VERSIONS
dlerror() is present in glibc 2.0 and later.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------+---------------+---------+
|Interface | Attribute | Value |
+----------+---------------+---------+
|dlerror() | Thread safety | MT-Safe |
+----------+---------------+---------+
CONFORMING TO
POSIX.1-2001.
NOTES
The message returned by dlerror() may reside in a statically allocated buffer that is overwritten by subsequent dlerror() calls.
History
This function is part of the dlopen API, derived from SunOS.
EXAMPLE
See dlopen(3).
SEE ALSO
dladdr(3), dlinfo(3), dlopen(3), dlsym(3)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-09-15 DLERROR(3)