From owner-freebsd-hackers Mon Sep 4 21:11:23 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from avocet.prod.itd.earthlink.net (avocet.prod.itd.earthlink.net [207.217.121.50]) by hub.freebsd.org (Postfix) with ESMTP id F269F37B423 for ; Mon, 4 Sep 2000 21:11:17 -0700 (PDT) Received: from mike (sdn-ar-001txfworP071.dialsprint.net [168.191.159.55]) by avocet.prod.itd.earthlink.net (8.9.3-EL_1_3/8.9.3) with SMTP id VAA13157 for ; Mon, 4 Sep 2000 21:11:12 -0700 (PDT) From: Michael Owens To: hackers@freebsd.org Subject: dlopen() Date: Mon, 4 Sep 2000 23:16:17 -0500 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <00090423164501.01182@mike> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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