Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Sep 2000 23:16:17 -0500
From:      Michael Owens <owensmk@earthlink.net>
To:        hackers@freebsd.org
Subject:   dlopen()
Message-ID:  <00090423164501.01182@mike>

next in thread | raw e-mail | index | archive | help
I am trying an example I got from a magazine originally written for Linux
which dynamically loads shared libraries and instantiates C++ classes within
them. Being a recent FreeBSD convert, I intended to run this example on it.

However, I am having a problem. I did read the man page for dlopen(), and
searched the mailing lists for similar problems. Consequently, I learned to use
-Wl,export-dynamic, but still have not seemed to resolve the problem: when the
program calls dlopen to load the library, it returns

./libcircle.so: Undefined symbol "__pure_virtual"

Now if I remove all pure virtual functions, it naturally just leads to some
other symbol not being found, so I assume it's not a C++ related matter. Am I
just not linking correctly? My makefile is as follows:

---------

.cc.o:
 g++ -ggdb -c -fpic -fPIC $<

default:
 make testdcl

testdcl:         testdcl.o
 g++ -Wl,-export-dynamic -o testdcl testdcl.o 

libcircle.so:    circle.o
 g++ -shared -Wl,-export-dynamic -o libcircle.so circle.o

libsquare.so:    square.o
 g++ -shared -Wl,-export-dynamic -o libsquare.so square.o

all: testdcl libcircle.so libsquare.so 

clean:
 rm -f *.so *.o testdcl
--------

Any help would be greatly appreciated.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00090423164501.01182>