Redex: configure: error: Please install google-gflags library

Created on 15 Apr 2016  ·  10Comments  ·  Source: facebook/redex

configure: error: Please install google-gflags library
configure: error: ./configure failed for third-party/folly/folly

Most helpful comment

it works after using

 xcode-select --install
 sudo xcode-select --switch /Library/Developer/CommandLineTools/

now /usr/lib and /usr/local/lib are both in library search paths

➜  ~ clang -Xlinker -v
@(#)PROGRAM:ld  PROJECT:ld64-264.3.101
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
    /usr/lib
    /usr/local/lib

All 10 comments

Same issue on Mac OS X 10.10.5

Did you brew install gflags?

same issue on Mac OS X 10.11.4, and gflags-2.1.2 already installed

Can you give me the output of:

clang -x c -v -E /dev/null
clang -Xlinker -v

And also show where gflags is installed (probably /usr/local/lib/libgflags.dylib if you're using brew).
Most likely gflags is not in your library search path. xcode-select --install might clear it up.

➜  ~ clang -x c -v -E /dev/null
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -main-file-name null -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.9 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fdebug-compilation-dir /Users/kevin -ferror-limit 19 -fmessage-length 117 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c /dev/null
clang -cc1 version 7.0.2 based upon LLVM 3.7.0svn default target x86_64-apple-darwin15.4.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)
End of search list.
# 1 "/dev/null"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 325 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/dev/null" 2

➜  ~ clang -Xlinker -v
@(#)PROGRAM:ld  PROJECT:ld64-253.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib
Framework search paths:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/

The path of gflags is /usr/local/lib/libgflags.dylib, and it is not in library search path. I will try xcode-select --install.

it works after using

 xcode-select --install
 sudo xcode-select --switch /Library/Developer/CommandLineTools/

now /usr/lib and /usr/local/lib are both in library search paths

➜  ~ clang -Xlinker -v
@(#)PROGRAM:ld  PROJECT:ld64-264.3.101
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
    /usr/lib
    /usr/local/lib

Yes really worked,But here is a new problem,
Couldn't find zipalign. Your APK may not be fully optimized.
I checked the build.gradle
zipAlignEnabled true
There are other places will affect it?

@logan62334

zipalign is an optimization step that is bundled with the Android SDK. You need to tell redex where to find it. For example, if you installed the SDK at /path/to/android/sdk, try:

ANDROID_SDK=/path/to/android/sdk redex [... arguments ...]
You can alternatively add zipalign to your PATH, for example:

PATH=/path/to/android/sdk/build-tools/xx.y.zz:$PATH redex [... arguments ...]

这是啥 xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools 错

@kamssun 表示你真的需要等安装(其实是更新)完xcode-select --install

Was this page helpful?
0 / 5 - 0 ratings