Can't import google v8 library [message #1784385] |
Tue, 27 March 2018 12:48 |
Florian Jean Messages: 3 Registered: March 2018 |
Junior Member |
|
|
Hello,
I'm trying to use the google v8 library.
So far, I compiled it as a static library and I m able to compile the hello-world example.
I'm able to compile the hello-world example from another directory with the command in the terminal :
Quote: g++ -I/home/florian/workspace/lib/v8/v8/include /home/florian/workspace/test_v8/test_v8.cc -o test_v8compiled2 -Wl,--start-group /home/florian/workspace/lib/v8/v8/out.gn/x64.release/obj/{libv8_{base,libbase,external_snapshot,libplatform,libsampler},third_party/icu/libicu{uc,i18n},src/inspector/libinspector}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x
However, I can't get to compile the Hello-world example using eclipse IDE
All Options from cross g++ compiler :
Quote:-std=c++0x -I/home/florian/workspace/lib/v8/v8/include -O0 -g3 -Wall -c -fmessage-length=0 -v
All Options from cross g++ linker :
Quote:-L/home/florian/workspace/lib/v8/v8/out.gn/x64.release/obj -L/home/florian/workspace/lib/v8/v8/out.gn/x64.release/obj/third_party/icu -L/home/florian/workspace/lib/v8/v8/out.gn/x64.release/obj/src/inspector
I also put the libraries in the Libraries option (-l)
v8_base
v8_libbase
.. So on
I get a lot of "undefined reference " error while compiling. What am I missing ??
Why doesn't the -l appear in the All Options from cross g++ linker ?
Thanks
|
|
|
Re: Can't import google v8 library [message #1784439 is a reply to message #1784385] |
Wed, 28 March 2018 02:16 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
You mean you can't link it.
It probably compiled OK.
The problem is that the libraries must be presented as a group to the linker.
This tells the linker to scan them repeatedly to resolve circular references.
They need to appear between --start-group and --end-group.
In the g++ command line these are preceded by -Wl, which means "pass to linker".
(Note: the comma is important)
ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html
It's going to be difficult to get the CDT tool chain to place these properly.
You may be able to get it done using the linker Miscellaneous settings.
However, it will likely be easier to create your own makefile.
[Updated on: Wed, 28 March 2018 06:24] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03473 seconds