Hi, i have read through the links and projects code you mentioned and also
tried to link v8 dynamically (which fails at the moment). I'm not 100%
percent sure but via "nm neptunjs | c++filt | grep v8::Throw" I looked up
the object definitions in my program and found "0805bb00 t
v8::ThrowException(v8::Handle<v8::Value>)" which is not found on dynamic
linking of the plugin. Is there any compiler/linker switch I overlooked to
make this definition public to the plugin or something else to get this
working? At the moment I'm trying to load my plugins with this code:
NativeClass* loadNMLib(string path) {
void* handle = dlopen(path.c_str(), RTLD_NOW|RTLD_GLOBAL); //It already
fails here because of "undefined symbols"
if (handle==NULL) { cout<<"Error: "<<dlerror()<<endl; return NULL; }
nld->create=(NativeClass* (*)())dlsym(handle, "createClassMapper");
...
}
Am Freitag, 28. September 2012 16:00:56 UTC+2 schrieb mschwartz:
>
> I meant no offense. I just don't see any command line examples in it that
> would help with the problem at hand (his plugin not finding symbols in main
> with statically linked v8 library).
>
> I also see no discussion of the loaded .so making calls to functions
> defined in the main program.
>
> Peace
>
> On Sep 28, 2012, at 6:44 AM, Stephan Beal
> <[email protected]<javascript:>>
> wrote:
>
> On Fri, Sep 28, 2012 at 3:39 PM, Michael Schwartz
> <[email protected]<javascript:>
> > wrote:
>
>> I didn't see anything useful at the link.
>>
>
> It explains, for example, why static libs are sometimes problematic in
> conjunction with C++ templates and plugins (because unreferenced symbols do
> not get linked in to the client).
>
>
>> The issue is you have a .so that's getting loaded via dlopen(). That .so
>> needs to call functions in the v8 library that is statically linked into
>> the main program.
>>
>
> For example. And if those do not get referenced from client code then they
> don't (or might not) get linked in.
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
>
> --
> v8-users mailing list
> [email protected] <javascript:>
> http://groups.google.com/group/v8-users
>
>
>
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users