Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstuff/libstuff.h:485:70: error: ‘strcasecmp’ was not declared in this scope #646

Open
jicman opened this issue May 20, 2019 · 3 comments

Comments

@jicman
Copy link

jicman commented May 20, 2019

Greetings.

I am trying to build BedrockDB in the cygwin environment. After commenting the,

#include <execinfo.h> // for backtrace

line in libstuff/libstuff.h, the compilation continued, but then I hit this wall:

g++ -g -std=c++14 -fpic -O2 -Wall -Werror -Wformat-security -DGIT_REVISION=f6d58b9 -I/home/e608313/builds/Bedrock -I/home/e608313/builds/Bedrock/mbedtls/include -MMD -MF libstuff/libstuff.d -MT libstuff/libstuff.h.gch -c libstuff/libstuff.h
libstuff/libstuff.h: In function ‘bool SIEquals(const string&, const string&)’:
libstuff/libstuff.h:485:70: error: ‘strcasecmp’ was not declared in this scope
inline bool SIEquals(const string& lhs, const string& rhs) { return !strcasecmp(lhs.c_str(), rhs.c_str()); }
^~~~~~~~~~
libstuff/libstuff.h:485:70: note: suggested alternative: ‘strncmp’
inline bool SIEquals(const string& lhs, const string& rhs) { return !strcasecmp(lhs.c_str(), rhs.c_str()); }
^~~~~~~~~~
strncmp
In file included from libstuff/libstuff.h:870:0:
libstuff/SRandom.h: At global scope:
libstuff/SRandom.h:7:27: error: ‘uint’ has not been declared
static string randStr(uint& length);
^~~~
make: *** No rule to make target 'libstuff/libstuff.d', needed by '.build/libstuff/libstuff.d'. Stop.

which now stops everything. The command executed within the Bedrock directory is,

CC=gcc GXX=g++ make

$ gcc --version
gcc (GCC) 7.4.0

$ make --version
GNU Make 4.2.1
Built for i686-pc-cygwin

Any help would be greatly appreciated. Thanks.

josé

@mamift
Copy link

mamift commented Sep 14, 2019

Hi, I think I found a solution:

In the libstuff.h: file, replace #include <string> with #include <strings.h>.

That fixed it for me. Found it from https://stackoverflow.com/questions/7248509/strcasecmp-was-not-declared-in-this-scope

@quinthar
Copy link
Contributor

Oh! That's great! Can you please create a PR and submit it for us to test? Thanks!

@mamift
Copy link

mamift commented Sep 14, 2019

I'll see what I can do. It seems fixing that one error just surfaced a bunch of others - I'll see how to go about fixing them as they seem to be specific to cygwin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants