Два модуля с одинаковым #include 'object.hpp' в 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'
что очевидно, поскольку он выбирает object.hpp из libzmq, я могу щелкнуть по
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, StringData object_type, 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;