Hi, I have looked into the makefiles (I'm using Netbeans for C++ to manage 
my project and create the makefiles) and searched for the flags you 
mentioned. I found out that it uses -O2 to compile but as far as I see that 
doesn't include on of this flags. Currently I compile and link with g++:
main:
compile: g++-4.6 -O2 -MMD -MP -MF [email protected] -o ${OBJECTDIR}/src/main.o 
src/main.cpp
linking: g++-4.6 -o bin/neptunjs ${OBJECTFILES} -lpthread -ldl -rdynamic

shared library:
compile: g++-4.6: -O2 -fPIC  -MMD -MP -MF [email protected] -o ${OBJECTDIR}/main.o 
main.cpp
linking: g++-4.6 -shared -o libbasic.so -fPIC ${OBJECTFILES}
I copied this code directly from the makefiles (and replaced some 
variables). I think if this isn't going to work I'm going back compiling 
the plugins directly into the program.

Am Samstag, 29. September 2012 04:30:56 UTC+2 schrieb Zhao Cheng:
>
> On Fri, Sep 28, 2012 at 4:58 AM, Moritz Willig 
> <[email protected]<javascript:>> 
> wrote: 
> > Hello, 
> > I'm new to C++ and of course to the V8 engine, too. I would like to 
> create 
> > an javascript service to send request to a server (something similar 
> > accessing an SQL Server). My main application code is executing without 
> > problems (i included V8 as a static library), but every time I try 
> accessing 
> > an plugin in an shared library, it produces many errors like " symbol 
> lookup 
> > error: ./libs/testplugin.so: undefined symbol: 
> > _ZN2v816FunctionTemplate16InstanceTemplateEv". I have really no idea how 
> to 
> > solve this errors. I have already searched solutions for this, but no 
> one 
> > worked for me. I assume that my program isn't able to find the matching 
> v8 
> > symbols. I have already added -Wl,-export-dynamic to the linker options, 
> but 
> > it still is not loading the library at runtime. 
>
> Since you mentioned '-Wl,-export-dynamic', I assume you're compiling 
> under Linux environment with GCC. 
>
> Genrally, if you link with static V8, a '-rdynamic' in ldflags would 
> do the job, if you still get symbol lookup errors, find if you have 
> '-fvisibility=hidden' and '-fvisibility-inlines-hidden' in your 
> cflags, which will hide all symbols. 
>
> Another reason for this error is those symbols are garbage collected 
> by compiler, see if you have ''-fdata-sections' and in cflags, and 
> '-Wl,--gc-sections' in ldflags. 
>
> -- 
> Cheng 
> Intel Open Source Technology Center 
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to