| Author |
undefined symbol: __pure_virtual
|
|
| niraj.kumar.ait@gmail.com 2005-08-30, 8:14 am |
| Hello All
I m getting undefined sysmol: __pure_virtual error .My shared
object is loaded in /usr/local/lib .I am using libtool to make shared
object .
Below is the code for makefile.am
AUTOMAKE_OPTIONS = gnu
OPTIONS = -lpthread -ldl
includedir = @includedir@/mss-backend
FLAGS = -g -fPIC --shared
lib_LTLIBRARIES = libApache.la libIptable.la
CXX=g++296
AM_CXXFLAGS=$(FLAGS)
libApache_la_SOURCES = apache.cpp
libIptable_la_SOURCES=iptable.cpp
include_HEADERS = parser.h apache.h iptable.h
libIptable_la_LIBADD=$(OPTIONS)
libApache_la_LIBADD=$(OPTIONS)
and the error Msg is
.../lib/libApache.so: undefined symbol: __pure_virtual
~
~
~
| |
| Nils O. Selåsdal 2005-08-30, 8:14 am |
| niraj.kumar.ait@gmail.com wrote:
> Hello All
>
> I m getting undefined sysmol: __pure_virtual error .My shared
> object is loaded in /usr/local/lib .I am using libtool to make shared
> object .
> Below is the code for makefile.am
Are you linking with g++ or gcc ? Since you seem to have c++ code,
link using g++.
It isn't clear when you get the error. I assume it is linking the
library itself ?
(state your platform and other relevant information as well.)
| |
| niraj.kumar.ait@gmail.com 2005-08-30, 8:14 am |
| I m loading it dynamically with dlopen dlsym
and compling the caller program with same compiler g++296
| |
| Nils O. Selåsdal 2005-08-30, 8:14 am |
| niraj.kumar.ait@gmail.com wrote:
> I m loading it dynamically with dlopen dlsym
> and compling the caller program with same compiler g++296
>
Ok. So compiling is good. What about linking.
And when do you get these errors ?
You should provide more relevant information,
it gives people a better change of helping.
(e.g. you platform, the error as copy pasted
from where you see it, inclusing relevant ? lines before
/after and so on)
| |
| Nils O. Selåsdal 2005-08-30, 8:14 am |
| Nils O. Selåsdal wrote:
> niraj.kumar.ait@gmail.com wrote:
>
> Ok. So compiling is good. What about linking.
> And when do you get these errors ?
> You should provide more relevant information,
> it gives people a better change of helping.
> (e.g. you platform, the error as copy pasted
> from where you see it, inclusing relevant ? lines before
> /after and so on)
That said, you might try to link to your library explicittly
to the gcc library. -lgcc
| |
| niraj.kumar.ait@gmail.com 2005-08-30, 8:14 am |
| Here tab is the object of Soloader object I m calling the below line
from a different file
SoLoader tab("../lib/libApache.so");
tab.LoadSo();
and in soloader file I have the following code
bool SoLoader::LoadSo(){
mHandle = dlopen(mSoPath.c_str(),RTLD_NOW); //Load Shared Object
std::cout<<"here is the handle-->"<<mHandle<<std::cout<<endl;
if(!mHandle){
std::cout<<"Error in loading shared obj"<<std::endl;
mErrorMessage = dlerror();
return false;
}
}
mHandle doesnt load the shared obj it gives following output
here is the handle-->(nil)0xffffffff
Error in loading shared obj
| |
| Ulrich Eckhardt 2005-08-30, 6:00 pm |
| niraj.kumar.ait@gmail.com wrote:
> std::cout<<"here is the handle-->"<<mHandle<<std::cout<<endl;
what's this ^^^^^^^^^^^
> mErrorMessage = dlerror();
What's the content of this string?
Other than that, what does ldd say when you run it on the plugin? If that
reports errors, it is either not linked correctly or dependencies are not
correctly installed. It depends on your system how that can be fixed.
Uli
--
http://www.erlenstar.demon.co.uk/unix/
|
|
|
|