Xcode中

问题描述

在我的项目中,我正在使用以下吊舱

def indy_api_pods
  pod 'libindy','1.11.1'
  pod 'OpenSSL-Universal'
  pod 'libsodium','1.0.12'
  pod 'libzmq','4.2.3'
end

target 'Indy' do
  project 'Indy/Indy.project'
  indy_api_pods
end

def db_api_pods
  pod 'RealmSwift','~> 5.5.0'
end

target 'DB.Realm' do
  project 'DB.Realm/DB.Realm.project'
  db_api_pods
end

RealmSwift和libzmq都获得了具有相同名称“ object.hpp”的文件。一切正常,直到我尝试构建DB.Realm项目为止,“ object.cpp”文件的开头为

#include "object.hpp"

然后它崩溃并显示错误UnkNown type name 'Object',这很明显,因为它是从libzmq中选择object.hpp的,我可以单击Realm/object.hpp重定向libzmq/object.hpp file

错误错误定向仅在构建失败后发生,因此我认为这必须与链接有关,因此我将Pods/Realm target/Build Settings/Linking/Runpath Search Paths设置为@executable_Path/Frameworks/Realm*@loader_path/Frameworks/Realm*,但没有帮助。

能否请我帮忙,以便我可以同时使用这两个吊舱?谢谢

更新:添加了构建输出

CompileC /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Objects-normal/armv7/object.o /Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Realm' from project 'Pods')
    cd /Users/ivan/Projects/SDK/Pods
    export LANG\=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -target armv7-apple-ios9.0 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=c++1z -stdlib\=libc++ -fmodules -gmodules -fmodules-cache-path\=/Users/ivan/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/ivan/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=Realm -fapplication-extension -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Werror\=deprecated-objc-isa-usage -Werror\=objc-root-class -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -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 -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DPOD_CONfigURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Index/DataStore -iquote /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Realm-generated-files.hmap -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Realm-own-target-headers.hmap -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Realm-all-non-framework-target-headers.hmap -ivfsoverlay /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/all-product-headers.yaml -iquote /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Realm-project-headers.hmap -iquote /Users/ivan/Projects/SDK/Pods/Realm/include -iquote /Users/ivan/Projects/SDK/Pods/Realm/include/Realm -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Products/Debug-iphoneos/Realm/include -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/DerivedSources-normal/armv7 -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/DerivedSources/armv7 -I/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/DerivedSources -F/Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Products/Debug-iphoneos/Realm -isystem /Users/ivan/Projects/SDK/Pods/Realm/include/core -fvisibility-inlines-hidden -fno-aligned-new -DREALM_HAVE_CONfig -DREALM_COCOA_VERSION\=@\"5.5.0\" -D__ASSERTMACROS__ -DREALM_ENABLE_SYNC -include /Users/ivan/Projects/SDK/Pods/Target\ Support\ Files/Realm/Realm-prefix.pch -MMD -MT dependencies -MF /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Objects-normal/armv7/object.d --serialize-diagnostics /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Objects-normal/armv7/object.dia -c /Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp -o /Users/ivan/Library/Developer/Xcode/DerivedData/SDK-App-hishxrupqxlxqmahlvrftehgogcq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/Realm.build/Objects-normal/armv7/object.o

/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:30:1: error: unkNown type name 'Object'
Object Object::freeze(std::shared_ptr<Realm> frozen_realm) const
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:30:8: error: use of undeclared identifier 'Object'
Object Object::freeze(std::shared_ptr<Realm> frozen_realm) const
       ^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:35:6: error: use of undeclared identifier 'Object'
bool Object::is_frozen() const noexcept
     ^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:40:1: error: use of undeclared identifier 'InvalidatedobjectException'
InvalidatedobjectException::InvalidatedobjectException(const std::string& object_type)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:45:1: error: use of undeclared identifier 'InvalidPropertyException'
InvalidPropertyException::InvalidPropertyException(const std::string& object_type,const std::string& property_name)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:50:1: error: use of undeclared identifier 'MissingPropertyValueException'
MissingPropertyValueException::MissingPropertyValueException(const std::string& object_type,const std::string& property_name)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:55:1: error: use of undeclared identifier 'MissingPrimaryKeyException'
MissingPrimaryKeyException::MissingPrimaryKeyException(const std::string& object_type)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:60:1: error: use of undeclared identifier 'ReadOnlyPropertyException'
ReadOnlyPropertyException::ReadOnlyPropertyException(const std::string& object_type,const std::string& property_name)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:64:1: error: use of undeclared identifier 'ModifyPrimaryKeyException'
ModifyPrimaryKeyException::ModifyPrimaryKeyException(const std::string& object_type,const std::string& property_name)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:68:1: error: use of undeclared identifier 'Object'
Object::Object(SharedRealm r,ObjectSchema const& s,Obj const& o)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:71:1: error: use of undeclared identifier 'Object'
Object::Object(SharedRealm r,Obj const& o)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:79:1: error: use of undeclared identifier 'Object'
Object::Object(SharedRealm r,StringData object_type,ObjKey key)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:87:1: error: use of undeclared identifier 'Object'
Object::Object(SharedRealm r,size_t index)
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:95:1: error: use of undeclared identifier 'Object'
Object::Object() = default;
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:96:1: error: use of undeclared identifier 'Object'
Object::~Object() = default;
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:97:1: error: use of undeclared identifier 'Object'
Object::Object(Object const&) = default;
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:97:16: error: unkNown type name 'Object'
Object::Object(Object const&) = default;
               ^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:98:1: error: use of undeclared identifier 'Object'
Object::Object(Object&&) = default;
^
/Users/ivan/Projects/SDK/Pods/Realm/Realm/ObjectStore/src/object.cpp:98:16: error: unkNown type name 'Object'
Object::Object(Object&&) = default;

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)