Closed ksubox closed 2 years ago
Can you try build & install with the branch lm/install mentioned here?
This branch is much better - all includes was installed (actually I understand that includes are part of realm-core) and I can compile... But not link - libcpprealm.so was not build, so only static libraries were installed:
sudo cmake --build . --target install | grep [.]a
-- Up-to-date: /usr/local/lib/librealm-dbg.a
-- Up-to-date: /usr/local/lib/librealm-parser-dbg.a
-- Up-to-date: /usr/local/lib/librealm-ffi-static-dbg.a
-- Up-to-date: /usr/local/lib/librealm-object-store-dbg.a
-- Up-to-date: /usr/local/lib64/librealm-sync-dbg.a
sudo cmake --build . --target install | grep [.]so
target_link_libraries(dbbench fmt realm-dbg realm-parser-dbg realm-ffi-static-dbg realm-object-store-dbg realm-sync-dbg cpprealm uv ssl crypto)
And I have a lot of unresolved:
undefined reference to `realm::realm_analytics::send()'
undefined reference to `realm::make_in_realm_history()'
...
PS: Actually it was built, but in another folder (src), so I copied to /usr/local/lib and included in target_link_libraries. Anyway a lot of undefined like:
undefined reference to `realm::make_in_realm_history()'
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/librealm-object-store-dbg.a(realm_coordinator.cpp.o): in function `realm::_impl::RealmCoordinator::open_db()':
undefined reference to `realm::make_in_realm_history()'
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/librealm-object-store-dbg.a(sync_session.cpp.o): in function `realm::SyncSession::download_fresh_realm(realm::sync::ProtocolErrorInfo::Action)::{lambda(realm::sync::SubscriptionSet::State)#1}::operator()(realm::sync::SubscriptionSet::State) const::{lambda(std::error_code)#1}::operator()(std::error_code)':
Finally I rearranged libraries in target_link_libraries and built executable.
Unfortunately first simplest action - open database crashed:
Do you have any idea why?
struct MyRealmObject: realm::object {
realm::persisted<std::string> _id;
realm::persisted<std::string> typeId;
realm::persisted<std::vector<std::string>> keys;
static constexpr auto schema = realm::schema("MyRealmObject",
realm::property<&MyRealmObject::_id, true>("_id"), // primary key
realm::property<&MyRealmObject::typeId>("typeId"),
realm::property<&MyRealmObject::keys>("keys"));
};
Very strange, that shouldn't happen. I'll try reproduce on OpenSUSE Tumbleweed.
With your last commit everything works well. Thank you. Would be good to update realm-core dependency to latest.
Hello,
Recently found cpp implementation for Realm and tried to build test program, but failed. I have latest OpenSUSE Tumbleweed. Here is build Realm result:
So build process looks OK. Then I make project with Realm cpp code
and CMakeList.txt is:
But got error:
I guess some incude files was not installed and add include paths to CMakeLists.txt:
With this additions I could compile, but got a lot of link errors:
I found several static libs in build directory and one by one added to target_link_libraries, and almost eliminated link errors.
but finally got unresolved SSL_write@@OPENSSL_1_1_0 I added ssl & crypto to target_link_libraries and then got a lot of new unresolved:
Then I fill tired and guess I do something wrong.... Could you help me to build and test cpp-realm application ?