infer icon indicating copy to clipboard operation
infer copied to clipboard

fatal error: 'glog/logging.h' file not found

Open WishQi opened this issue 9 years ago • 6 comments

The command: xcodebuild -workspace Name.xcworkspace -configuration Debug -Name Aweme works fine and build succeeded. But when I run: infer capture --keep-going --no-xcpretty -- xcodebuild -workspace Name.xcworkspace -configuration Debug -scheme Name It will show that:

In file included from /Users/limaoqi/Desktop/Aweme/Aweme/RNBundle/node_modules/react-native/ReactCommon/jschelpers/JSCWrapper.cpp:17: /usr/local/Cellar/infer/0.13.0/lib/infer/infer/models/cpp/include/glog/logging.h:16:15: fatal error: 'glog/logging.h' file not found #include_next <glog/logging.h> ^~~~~~~~~~~~~~~~ 1 error generated. Error: the following clang command did not run successfully: '/usr/local/Cellar/infer/0.13.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang++' "@/var/folders/cz/6k50rwpn35s1j3t3hr82rs700000gp/T/clang_command_94f321.txt"

And the result is:

*** clang: Caught sigint, time to die

** BUILD FAILED **

The following build commands failed: CompileC /Users/limaoqi/Library/Developer/Xcode/DerivedData/Aweme-bkezrnqnlfrskocmuntegwvejtzf/Build/Intermediates.noindex/Pods.build/AwemeDebug-iphoneos/React-iOS8.0.build/Objects-normal/armv7/JSCWrapper.o /Users/limaoqi/Desktop/Aweme/Aweme/RNBundle/node_modules/react-native/ReactCommon/jschelpers/JSCWrapper.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Error backtrace: Raised at file "integration/Driver.ml", line 297, characters 16-78 Called from file "integration/Driver.ml", line 176, characters 2-16 Called from file "backend/infer.ml", line 23, characters 2-36 Called from file "backend/infer.ml", line 106, characters 6-52 Uncaught error: ("InferModules__Driver.Infer_error("exited with code 65")")

I am sure the "xcodebuild" command alone works fine and the workspace is clean before run infer. The logs is:

I installed infer via homebrew, and the xcodebuild version is 9.1. How can I solve this problem?

WishQi avatar Nov 17 '17 09:11 WishQi

can you pass --no-cxx-infer-headers to Infer and check if it solves the problem?

dulmarod avatar Nov 17 '17 11:11 dulmarod

@dulmarod Thank you so much, --no-cxx-infer-headers works fine for the last problem. But there is a new problem: it showed me many redefinition errors, for example:

In file included from /Users/limaoqi/Desktop/Aweme/Aweme/Pods/HTSAccountService/HTSAccountService/Classes/Platform/QQ/NHAccountPlatformQQ.m:11: In file included from /Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentApiInterface.h:12: /Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentMessageObject.h:65:5: error: redefinition of enumerator 'ReqFromThirdAppShowContent' ReqFromThirdAppShowContent, ^ In file included from /Users/limaoqi/Desktop/Aweme/Aweme/Pods/HTSAccountService/HTSAccountService/Classes/Platform/QQ/NHAccountPlatformQQ.m:10: In file included from /Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentOAuth.h:12: /Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentApiInterface.h:12:9: note: '/Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentMessageObject.h' included multiple times, additional include site here #import "TencentMessageObject.h" ^ In file included from /Users/limaoqi/Desktop/Aweme/Aweme/Pods/HTSAccountService/HTSAccountService/Classes/Platform/QQ/NHAccountPlatformQQ.m:11: /Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentApiInterface.h:12:9: note: '/Users/limaoqi/Desktop/Aweme/Aweme/Pods/Headers/Public/HTSSDKManager/TencentOpenAPI/TencentMessageObject.h' included multiple times, additional include site here #import "TencentMessageObject.h" ^

and finally the result:

*** clang: Caught sigint, time to die

** BUILD FAILED **

The following build commands failed: CompileC /Users/limaoqi/Library/Developer/Xcode/DerivedData/Aweme-bkezrnqnlfrskocmuntegwvejtzf/Build/Intermediates.noindex/Pods.build/AwemeDebug-iphoneos/HTSAccountService-Core-QQ-Wechat-Weibo.build/Objects-normal/armv7/NHAccountPlatformQQ.o HTSAccountService/HTSAccountService/Classes/Platform/QQ/NHAccountPlatformQQ.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Error backtrace: Raised at file "integration/Driver.ml", line 297, characters 16-78 Called from file "integration/Driver.ml", line 176, characters 2-16 Called from file "backend/infer.ml", line 23, characters 2-36 Called from file "backend/infer.ml", line 106, characters 6-52 Uncaught error: ("InferModules__Driver.Infer_error("exited with code 65")")

I will appreciate it if you can help me.

WishQi avatar Nov 17 '17 12:11 WishQi

Thank you so much. I have solved my problem.

WishQi avatar Nov 20 '17 02:11 WishQi

Hey! How did you solve this problem?

ayushiSharma22 avatar Sep 20 '18 06:09 ayushiSharma22

Sorry, I have forgot about this problem. But the recommended way for ios project to use infer is like this: right way

WishQi avatar Sep 20 '18 06:09 WishQi

Oh! Thanks :)

ayushiSharma22 avatar Sep 20 '18 07:09 ayushiSharma22