Croaring error when run in linux

25 views
Skip to first unread message

Aniket Agarwalla

unread,
May 17, 2021, 4:42:23 AM5/17/21
to Roaring Bitmaps
Please help me rectify this,

aniket@aniket-VirtualBox:~/Desktop/bitmap$ g++ main.cpp
/usr/bin/ld: /tmp/cc0q6VnI.o: in function `roaring_bitmap_init_cleared':
main.cpp:(.text.roaring_bitmap_init_cleared[_ZN7roaring7RoaringC5Ev]+0x19): undefined reference to `roaring_bitmap_init_with_capacity'
/usr/bin/ld: /tmp/cc0q6VnI.o: in function `roaring::Roaring::Roaring(roaring::Roaring const&)':
main.cpp:(.text._ZN7roaring7RoaringC2ERKS0_[_ZN7roaring7RoaringC5ERKS0_]+0x32): undefined reference to `roaring_bitmap_overwrite'
/usr/bin/ld: /tmp/cc0q6VnI.o: in function `roaring::Roaring::add(unsigned int)':
main.cpp:(.text._ZN7roaring7Roaring3addEj[_ZN7roaring7Roaring3addEj]+0x20): undefined reference to `roaring_bitmap_add'
/usr/bin/ld: /tmp/cc0q6VnI.o: in function `roaring::Roaring::~Roaring()':
main.cpp:(.text._ZN7roaring7RoaringD2Ev[_ZN7roaring7RoaringD5Ev]+0x18): undefined reference to `roaring_bitmap_clear'
/usr/bin/ld: /tmp/cc0q6VnI.o: in function `roaring::Roaring::cardinality() const':
main.cpp:(.text._ZNK7roaring7Roaring11cardinalityEv[_ZNK7roaring7Roaring11cardinalityEv]+0x18): undefined reference to `roaring_bitmap_get_cardinality'
collect2: error: ld returned 1 exit status

Daniel Lemire

unread,
May 17, 2021, 9:41:01 AM5/17/21
to Roaring Bitmaps
You do not tell us what is in 'main.cpp', and it is not clear how you are compiling or linking against CRoaring, but the error is telling you that you are missing function definitions.

Aniket Agarwalla

unread,
May 17, 2021, 9:51:34 AM5/17/21
to Roaring Bitmaps


Hi, I have used example2.cpp given in tests, and tried to compile it using g++ main.cpp after doing the CMake build and make install. when I run the ctests it worked completely fine. I wanted to know what command I should use to compile the files or do we have a makefile for that.

Daniel Lemire

unread,
May 17, 2021, 11:10:37 AM5/17/21
to Roaring Bitmaps
There are many ways to use a C library. Here is an example using CMake:

Aniket Agarwalla

unread,
May 17, 2021, 11:46:48 AM5/17/21
to Daniel Lemire, Roaring Bitmaps
Thanks a lot sir for the information.
 It helped me.



--
You received this message because you are subscribed to a topic in the Google Groups "Roaring Bitmaps" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/roaring-bitmaps/75ut76ms6TU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to roaring-bitma...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/f551442a-1c3a-4c22-8029-94c8481a2cebn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages