c++ client build error: stress.cpp:121: error: ‘memset’ was not declared in this scope

351 views
Skip to first unread message

Paul Rock

unread,
Aug 19, 2010, 12:44:42 PM8/19/10
to project-voldemort
Trying out voldemort on my local Ubuntu install, and when trying to
build the c++ client I'm getting an error:

~/voldemort-0.81/clients/cpp/utils$ make
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -pthread -MT
stress.o -MD -MP -MF .deps/stress.Tpo -c -o stress.o stress.cpp
stress.cpp: In function ‘int main(int, char**)’:
stress.cpp:121: error: ‘memset’ was not declared in this scope
make: *** [stress.o] Error 1

it's been forever since I've done any c++ coding, anyone have a quick
fix for this before I go digging around on the web?

Alex Feinberg

unread,
Aug 19, 2010, 1:04:35 PM8/19/10
to project-...@googlegroups.com
Hey Paul,

Depending on the compiler/version, memset (in string.h) may or may not
be exported into the default scope. Can you see if adding

#include <cstring>

or #include <string.h> in stress.cpp fixes this? If it does, I'll
patch the code.

I'd verify this myself, but I am on a new OS X machine and it doesn't
have boost installed (would probably be faster for you to verify this,
rather for me to wait for boost to finish building).

Thanks,
- Alex

> --
> You received this message because you are subscribed to the Google Groups "project-voldemort" group.
> To post to this group, send email to project-...@googlegroups.com.
> To unsubscribe from this group, send email to project-voldem...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/project-voldemort?hl=en.
>
>

Paul Rock

unread,
Aug 19, 2010, 2:05:16 PM8/19/10
to project-voldemort
I added the include for cstring and it works, thanks!

~/voldemort-0.81/clients/cpp/utils$ make
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -pthread -MT
stress.o -MD -MP -MF .deps/stress.Tpo -c -o stress.o stress.cpp
mv -f .deps/stress.Tpo .deps/stress.Po
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -pthread -o
stress stress.o ../src/libvoldemort.la -lexpat -lprotobuf
libtool: link: g++ -g -O2 -pthread -o .libs/stress stress.o ../
src/.libs/libvoldemort.so /usr/lib/libexpat.so /usr/lib/libprotobuf.so
-pthread

~/voldemort-0.81/clients/cpp$ make check
Making check in src
make[1]: Entering directory `/home/prock/voldemort-0.81/clients/cpp/
src'
make check-am
make[2]: Entering directory `/home/prock/voldemort-0.81/clients/cpp/
src'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp/
src'
make[1]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp/
src'
Making check in utils
make[1]: Entering directory `/home/prock/voldemort-0.81/clients/cpp/
utils'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp/
utils'
Making check in test
make[1]: Entering directory `/home/prock/voldemort-0.81/clients/cpp/
test'
make check-TESTS
make[2]: Entering directory `/home/prock/voldemort-0.81/clients/cpp/
test'
Running 20 test cases...

*** No errors detected
PASS: voldemort_test
=============
1 test passed
=============
make[2]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp/
test'
make[1]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp/
test'
make[1]: Entering directory `/home/prock/voldemort-0.81/clients/cpp'
make[1]: Leaving directory `/home/prock/voldemort-0.81/clients/cpp'


On Aug 19, 1:04 pm, Alex Feinberg <feinb...@gmail.com> wrote:
> Hey Paul,
>
> Depending on the compiler/version, memset (in string.h) may or may not
> be exported into the default scope. Can you see if adding
>
> #include <cstring>
>
> or #include <string.h> in stress.cpp fixes this? If it does, I'll
> patch the code.
>
> I'd verify this myself, but I am on a new OS X machine and it doesn't
> have boost installed (would probably be faster for you to verify this,
> rather for me to wait for boost to finish building).
>
> Thanks,
> - Alex
>

Alex Feinberg

unread,
Aug 19, 2010, 6:23:47 PM8/19/10
to project-...@googlegroups.com
Thanks!

Pushed it.

- Alex

Reply all
Reply to author
Forward
0 new messages