vgteam / libhandlegraph

Library for the Handle Graph abstraction
MIT License
21 stars 5 forks source link

undefined reference to `increment_node_ids(long)` #54

Closed ekg closed 4 years ago

ekg commented 4 years ago

I'm attempting to use libodgi and libhandlegraph together, and getting errors like this:

/usr/bin/ld: odgi-prefix/lib/libodgi.a(odgi.cpp.o):(.data.rel.ro._ZTCN4odgi7graph_tE208_N11handlegraph20DeletableHandleGraphE[_ZTVN4odgi7graph_tE]+0x1e8): undefined reference to `handlegraph::MutableHandleGraph::increment_node_ids(long)'
/usr/bin/ld: odgi-prefix/lib/libodgi.a(odgi.cpp.o):(.data.rel.ro._ZTCN4odgi7graph_tE208_N11handlegraph18MutableHandleGraphE[_ZTVN4odgi7graph_tE]+0x190): undefined reference to `handlegraph::MutableHandleGraph::increment_node_ids(long)'
/usr/bin/ld: odgi-prefix/lib/libodgi.a(odgi.cpp.o):(.data.rel.ro._ZTCN4odgi7graph_tE0_N11handlegraph29MutablePathMutableHandleGraphE[_ZTVN4odgi7graph_tE]+0x4e8): undefined reference to `handlegraph::MutableHandleGraph::increment_node_ids(long)'
/usr/bin/ld: odgi-prefix/lib/libodgi.a(odgi.cpp.o):(.data.rel.ro._ZTCN4odgi7graph_tE0_N11handlegraph31MutablePathDeletableHandleGraphE[_ZTVN4odgi7graph_tE]+0x518): undefined reference to `handlegraph::MutableHandleGraph::increment_node_ids(long)'

It looks like there is a kind of confusion about nid_t and long, and this virtual function isn't being instantiated correctly.

This can be resolved by adding a specialization of the function for long.