Realm-js: compile realmjs 1.13.0 with error

Created on 3 Jan 2018  路  12Comments  路  Source: realm/realm-js

$ clang -v
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /usr/local/bin

i am creating a react-native application with realmjs 1.13.0,and encountered the following error while starting up the app, how could i solve it? any hint would be appreciated.

CompileC /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/Objects-normal/x86_64/GCDWebServerRequest.o /Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/vendor/GCDWebServer/GCDWebServer/Core/GCDWebServerRequest.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/src
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/Users/crazybit/Library/Android/sdk/tools:/Users/crazybit/Library/Android/sdk/platform-tools"
/Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/src/../scripts/ccache-clang.sh -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DREALM_DEBUG -DREALM_HAVE_CONFIG -D__ASSERTMACROS__ -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=7.0 -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Index/DataStore -iquote /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/GCDWebServers-generated-files.hmap -I/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/GCDWebServers-own-target-headers.hmap -I/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/GCDWebServers-all-target-headers.hmap -iquote /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/GCDWebServers-project-headers.hmap -I/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Products/Debug-iphonesimulator/include -I/Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/src/object-store/src -I/Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/src/../vendor -I/Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/src/../vendor/core/include -I/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/DerivedSources/x86_64 -I/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/DerivedSources -F/Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/Objects-normal/x86_64/GCDWebServerRequest.d --serialize-diagnostics /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/Objects-normal/x86_64/GCDWebServerRequest.dia -c /Users/crazybit/go/src/github.com/BitAssetManagement/node_modules/realm/vendor/GCDWebServer/GCDWebServer/Core/GCDWebServerRequest.m -o /Users/crazybit/go/src/github.com/BitAssetManagement/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/GCDWebServers.build/Objects-normal/x86_64/GCDWebServerRequest.o

clang-4.0: error: cannot specify -o when generating multiple output files

T-Help

All 12 comments

Please use the issue template to provide relevant information.

Goals

Build React native app with Realm

Expected Results

The app should be started up succesfully

Actual Results

Compile the Realm with error, error was provided as above

Steps to Reproduce

start the React Native App with command "React-native run-ios"

Code Sample

N/A

Version of Realm and Tooling

  • Realm JS SDK Version: 1.13.0
  • Node or React Native: React Native
  • Client OS & Version: MacOS High Sierra(10.13.2)
  • Which debugger for React Native: N/A

Which version of Xcode do you use?

my xcode version is 9.2 (9C40b)

You will probably have to update to version 2.1.0 to use Xcode 9.x.

upgrade to 2.10 still no luck, same error

Not sure but can it be your clang?

$ which clang
/usr/bin/clang
$ clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@kneth, millions thanks, it is really due to the clang version, case closed.

@crazybits
How did you solve this issue?
I'm having the same issue but my clang version seems fine.

Got Update from @crazybits, the clang version is wrong. Problem solved by changing the path to the clang path of the XCODE. Steps As below.

  1. open bash_profile
    vi ~/.bash_profile
  2. change PATH
    export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:{existing path}
  3. enable the change
    source ~/.bash_profile

In my case, it wasn't the clang version that was the issue. I ended up wasting multiple hours trying to update it when it was actually something much simpler.

Instead, try setting Enable Index-While-Building Functionality to No in XCode.

In Xcode, Build Settings > Build Options > Enable Index-While-Building Functionality set it to No.

Screen Shot 2019-04-07 at 8 57 07 AM

If that worked, make sure to upvote this answer where I got it from:

https://stackoverflow.com/a/48717558/293280

Versions

| | |
|-|-|
| XCode | 10.2
| realm-js | master branch
| clang | Apple LLVM version 10.0.1 (clang-1001.0.46.3)
| node | v10.11.0

@joshuapinter Thanks for sharing!

Was this page helpful?
0 / 5 - 0 ratings