Problem on compilation
See original GitHub issueOriginally filed by user @ovr
Hey! I am using realm-js v1.1.1
Error
/Users/ovr/projects/interpals/frontend/native/node_modules/realm/src/object-store/src/object.cpp:42:20: error: no viable overloaded '='
m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ovr/projects/interpals/frontend/native/node_modules/realm/src/object-store/src/object.cpp:19:
In file included from /Users/ovr/projects/interpals/frontend/native/node_modules/realm/src/object-store/src/object.hpp:22:
/Users/ovr/projects/interpals/frontend/native/node_modules/realm/src/object-store/src/impl/collection_notifier.hpp:256:13: note: candidate function not viable: no known conversion from 'typename enable_if<!is_array<ObjectNotifier>::value, shared_ptr<ObjectNotifier> >::type' (aka 'std::__1::shared_ptr<realm::_impl::ObjectNotifier>') to 'const realm::_impl::CollectionNotifier::Handle<realm::_impl::ObjectNotifier>' for 1st argument
Handle& operator=(const Handle& other)
^
/Users/ovr/projects/interpals/frontend/native/node_modules/realm/src/object-store/src/impl/collection_notifier.hpp:265:13: note: candidate function not viable: no known conversion from 'typename enable_if<!is_array<ObjectNotifier>::value, shared_ptr<ObjectNotifier> >::type' (aka 'std::__1::shared_ptr<realm::_impl::ObjectNotifier>') to 'realm::_impl::CollectionNotifier::Handle<realm::_impl::ObjectNotifier>' for 1st argument
Handle& operator=(Handle&& other)
^
1 error generated.
My ENV
clang -v
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Compilation Problems
Here are the most common problems that you might encounter when compiling a program that uses the JNDI classes. Class or Package Not...
Read more >Java: Unresolved compilation problem
10 Answers 10 · Just try to include package name in eclipse in case if you forgot it · Import all packages before...
Read more >How to find and fix the "Problem during compilation" error in ...
Chapters. View all · Introduction · Introduction · Introduction · Reasons for " problem during compilation " error · Reasons for " problem...
Read more >Handling Compilation Problems
Handling Compilation Problems. When you compile your COBOL programs, you can direct any error messages to a file, which you can examine after...
Read more >Help with finding the problem in compilation - TeX
Help with finding the problem in compilation ... submit the paper to arXiv, it simply does not compile over there and no pdf...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
RealmReact.mm File /<----- Chaining
//Add this code
#import “RealmReact.h” #import “RealmAnalytics.h”
#import “jsc/jsc_init.h”
#import “impl/realm_coordinator.hpp” #import “shared_realm.hpp”
#import <React/RCTBridge+Private.h> #import <React/RCTJavaScriptExecutor.h>
#import <objc/runtime.h> #import <arpa/inet.h> #import <ifaddrs.h> #import <netdb.h> #import <net/if.h>
#if DEBUG #import “GCDWebServer.h” #import “GCDWebServerDataRequest.h” #import “GCDWebServerDataResponse.h” #import “GCDWebServerErrorResponse.h” #import “rpc.hpp”
#define WEB_SERVER_PORT 8083
using namespace realm::rpc; #endif
@interface NSObject ()
// the part of the RCTCxxBridge private class we care about @interface RCTBridge (Realm_RCTCxxBridge)
extern “C” JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executor, bool create) { Ivar contextIvar = class_getInstanceVariable([executor class], “_context”); if (!contextIvar) { return NULL; }
}
@interface RealmReact () <RCTBridgeModule> @end
@implementation RealmReact { NSMutableDictionary *_eventHandlers;
#if DEBUG GCDWebServer *_webServer; std::unique_ptr<RPCServer> _rpcServer; #endif }
@synthesize bridge = _bridge;
RCT_EXPORT_MODULE(Realm)
(BOOL)requiresMainQueueSetup { return YES; }
(void)initialize { if (self != [RealmReact class]) { return; }
RLMSendAnalytics(); }
(instancetype)init { self = [super init]; if (self) { _eventHandlers = [[NSMutableDictionary alloc] init]; } return self; }
(dispatch_queue_t)methodQueue { return dispatch_get_main_queue(); }
(NSDictionary *)constantsToExport { #if DEBUG #if TARGET_IPHONE_SIMULATOR NSArray *hosts = @[@“localhost”]; #else NSArray *hosts = [self getIPAddresses]; #endif
return @{ @“debugHosts”: hosts, @“debugPort”: @(WEB_SERVER_PORT), }; #else return @{}; #endif }
(void)addListenerForEvent:(NSString *)eventName handler:(RealmReactEventHandler)handler { NSMutableOrderedSet *handlers = _eventHandlers[eventName]; if (!handlers) { handlers = _eventHandlers[eventName] = [[NSMutableOrderedSet alloc] init]; } [handlers addObject:handler]; }
(void)removeListenerForEvent:(NSString *)eventName handler:(RealmReactEventHandler)handler { NSMutableOrderedSet *handlers = _eventHandlers[eventName]; [handlers removeObject:handler]; }
RCT_REMAP_METHOD(emit, emitEvent:(NSString *)eventName withObject:(id)object) { for (RealmReactEventHandler handler in [_eventHandlers[eventName] copy]) { handler(object); } }
#if DEBUG
(NSArray *)getIPAddresses { static const char * const wifiInterface = “en0”;
struct ifaddrs *ifaddrs; if (getifaddrs(&ifaddrs)) { NSLog(@“Failed to get interface addresses: %s”, strerror(errno)); return @[]; }
NSMutableArray *ipAddresses = [[NSMutableArray alloc] init]; char host[INET6_ADDRSTRLEN];
for (struct ifaddrs *ifaddr = ifaddrs; ifaddr; ifaddr = ifaddr->ifa_next) { if ((ifaddr->ifa_flags & IFF_LOOPBACK) || !(ifaddr->ifa_flags & IFF_UP)) { // Ignore loopbacks and interfaces that aren’t up. continue; }
}
freeifaddrs(ifaddrs); return [ipAddresses copy]; }
(void)startRPC { [GCDWebServer setLogLevel:3]; _webServer = [[GCDWebServer alloc] init]; _rpcServer = std::make_unique<RPCServer>(); __weak typeof(self) weakSelf = self;
// Add a handler to respond to POST requests on any URL [_webServer addDefaultHandlerForMethod:@“POST” requestClass:[GCDWebServerDataRequest class] processBlock:^GCDWebServerResponse (GCDWebServerRequest request) { typeof(self) self = weakSelf; RPCServer *rpcServer = self ? self->_rpcServer.get() : nullptr; GCDWebServerResponse *response;
[_webServer startWithPort:WEB_SERVER_PORT bonjourName:nil]; return; }
(void)shutdownRPC { [_webServer stop]; [_webServer removeAllHandlers]; _webServer = nil; _rpcServer.reset(); } #endif
(void)invalidate { #if DEBUG // shutdown rpc if in chrome debug mode [self shutdownRPC]; #endif }
(void)dealloc { [self performSelectorOnMainThread:@selector(invalidate) withObject:nil waitUntilDone:YES]; }
typedef JSGlobalContextRef (^JSContextRefExtractor)();
void _initializeOnJSThread(JSContextRefExtractor jsContextExtractor) { // Make sure the previous JS thread is completely finished before continuing. static __weak NSThread *s_currentJSThread; while (s_currentJSThread && !s_currentJSThread.finished) { [NSThread sleepForTimeInterval:0.1]; } s_currentJSThread = [NSThread currentThread];
}
(void)setBridge:(RCTBridge *)bridge { _bridge = bridge;
static __weak RealmReact *s_currentModule = nil; [s_currentModule invalidate]; s_currentModule = self;
if (objc_lookUpClass(“RCTWebSocketExecutor”) && [bridge executorClass] == objc_lookUpClass(“RCTWebSocketExecutor”)) { #if DEBUG [self startRPC]; #else @throw [NSException exceptionWithName:@“Invalid Executor” reason:@“Chrome debug mode not supported in Release builds” userInfo:nil]; #endif } else if ([bridge isKindOfClass:objc_lookUpClass(“RCTCxxBridge”)]) { // probe for the new C++ bridge in React Native 0.45+
} else { // React Native 0.44 and older id<RCTJavaScriptExecutor> executor = [bridge valueForKey:@“javaScriptExecutor”]; __weak typeof(self) weakSelf = self; __weak typeof(executor) weakExecutor = executor;
} }
@end
I assume all is good. closing this one