STL link errors when including libv8_libplatform.a

77 views
Skip to first unread message

Aaron Jacobs

unread,
Apr 30, 2015, 6:17:20 PM4/30/15
to v8-u...@googlegroups.com
Hi v8-users,

I am attempting to build gjstest (https://github.com/google/gjstest)
against V8 4.1.0.27, installed via homebrew on OS X 10.10.3.

This is *almost* working, at commit 45175c7 for the record. But when I go to
link the binary, I get a string of undefined symbol errors related to V8's use
of the STL. Here's one, full paste below:

Undefined symbols for architecture x86_64:
[snip]
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
v8::platform::DefaultPlatform::~DefaultPlatform() in
libv8_libplatform.a(default-platform.o)
std::_Rb_tree<v8::Isolate*, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > >, std::_Select1st<std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > >, std::less<v8::Isolate*>,
std::allocator<std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > >
>::_M_insert_unique(std::_Rb_tree_iterator<std::pair<v8::Isolate*
const, std::queue<v8::Task*, std::deque<v8::Task*,
std::allocator<v8::Task*> > > > >, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > const&) in libv8_libplatform.a(default-platform.o)
[snip]
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to
see invocation)

I assume this has something to do with me building my binary with slightly
different settings than the ones with which the library was built, but I can't
for the life of me figure it out. Any idea?

These are the flags I'm giving to g++:

-lprotobuf -lglog -lgflags -lxml2 -lre2 -lv8_libbase
-lv8_libplatform -lglog -lv8 -DHASH_NAMESPACE=__gnu_cxx -std=c++11 -I.
-I./third_party/gmock/include -I./third_party/gmock/gtest/include
-I/usr/include/libxml2 -I/usr/local/opt/libxml2/include/libxml2
-I/usr/local/include -DDEFAULT_DATA_DIR=/usr/local/share/gjstest
-L/usr/local/lib

In particular, "-DHASH_NAMESPACE=__gnu_cxx -std=c++11" may be relevant?

Thanks,
Aaron


Full paste
--------------------------------------------------
+ g++ base/stringprintf.o file/file_utils.o
gjstest/internal/proto/named_scripts.pb.o strings/ascii_ctype.o
strings/strutil.o gjstest/internal/cpp/builtin_data.o base/timer.o
base/callback.o gjstest/internal/cpp/v8_utils.o
gjstest/internal/cpp/test_case.o webutil/xml/xml_writer.o
gjstest/internal/cpp/run_tests.o gjstest/internal/cpp/typed_arrays.o
gjstest/internal/cpp/gjstest.o -lprotobuf -lglog -lgflags -lxml2 -lre2
-lv8_libbase -lv8_libplatform -lglog -lv8 -DHASH_NAMESPACE=__gnu_cxx
-std=c++11 -I. -I./third_party/gmock/include
-I./third_party/gmock/gtest/include -I/usr/include/libxml2
-I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/include
-DDEFAULT_DATA_DIR=/usr/local/share/gjstest -L/usr/local/lib -o
gjstest/internal/cpp/gjstest.bin
Undefined symbols for architecture x86_64:
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree<v8::Isolate*, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > >, std::_Select1st<std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > >, std::less<v8::Isolate*>,
std::allocator<std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > >
>::_M_insert_unique(std::_Rb_tree_iterator<std::pair<v8::Isolate*
const, std::queue<v8::Task*, std::deque<v8::Task*,
std::allocator<v8::Task*> > > > >, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > const&) in libv8_libplatform.a(default-platform.o)
std::_Rb_tree<v8::Isolate*, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > >, std::_Select1st<std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > >, std::less<v8::Isolate*>,
std::allocator<std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > >
>::_M_insert_unique(std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > const&) in libv8_libplatform.a(default-platform.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
v8::platform::DefaultPlatform::~DefaultPlatform() in
libv8_libplatform.a(default-platform.o)
std::_Rb_tree<v8::Isolate*, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > >, std::_Select1st<std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > >, std::less<v8::Isolate*>,
std::allocator<std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > >
>::_M_insert_unique(std::_Rb_tree_iterator<std::pair<v8::Isolate*
const, std::queue<v8::Task*, std::deque<v8::Task*,
std::allocator<v8::Task*> > > > >, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > const&) in libv8_libplatform.a(default-platform.o)
"std::__throw_length_error(char const*)", referenced from:
std::vector<v8::platform::WorkerThread*,
std::allocator<v8::platform::WorkerThread*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<v8::platform::WorkerThread**,
std::vector<v8::platform::WorkerThread*,
std::allocator<v8::platform::WorkerThread*> > >,
v8::platform::WorkerThread* const&) in
libv8_libplatform.a(default-platform.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<v8::Isolate*, std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > >, std::_Select1st<std::pair<v8::Isolate* const,
std::queue<v8::Task*, std::deque<v8::Task*, std::allocator<v8::Task*>
> > > >, std::less<v8::Isolate*>,
std::allocator<std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > >
>::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*,
std::pair<v8::Isolate* const, std::queue<v8::Task*,
std::deque<v8::Task*, std::allocator<v8::Task*> > > > const&) in
libv8_libplatform.a(default-platform.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Reply all
Reply to author
Forward
0 new messages