Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build using cmake on linux #167

Open
danielmbomfim opened this issue Feb 25, 2024 · 3 comments
Open

Failed to build using cmake on linux #167

danielmbomfim opened this issue Feb 25, 2024 · 3 comments

Comments

@danielmbomfim
Copy link

I am trying to build a very simple application using cmake and realm as a database. When trying to build using cmake on linux i am facing some errors about imports from the std namespace.

error: ‘uint_fast16_t’ in namespace ‘std’ does not name a type
cpprealm-src/src/cpprealm/internal/bridge/realm.hpp:29:1: note: ‘std::uint_fast16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?

I dont have much experience using c++ so i'm not sure if it's a error or some configuration problem.

This is my cmakelists file:

cmake_minimum_required(VERSION 3.15)

project(RealmRs)

set (REALM_CPP_NO_TESTS ON )
set(CMAKE_CXX_FLAGS "-fpermissive -Wchanges-meaning")

# Minimum C++ standard
set(CMAKE_CXX_STANDARD 17)

# In a Windows install, set these compiler flags:
if(MSVC)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor /bigobj")
endif()

# Include the FetchContent module so you can download the C++ SDK
Include(FetchContent)

# Declare the version of the C++ SDK you want to download
FetchContent_Declare(
  cpprealm
  GIT_REPOSITORY https://github.com/realm/realm-cpp.git
  GIT_TAG        v1.0.0
)

# The MakeAvailable command ensures the named dependencies have been populated
FetchContent_MakeAvailable(cpprealm)

add_library(test main.cpp)

target_link_libraries(test PRIVATE cpprealm)
Copy link

sync-by-unito bot commented Feb 25, 2024

➤ PM Bot commented:

Jira ticket: RCPP-50

@kneth
Copy link
Contributor

kneth commented Mar 6, 2024

@danielmbomfim Please tell us which compiler (and version) you are using and which platform you are targeting.

@danielmbomfim
Copy link
Author

@kneth I'm using gcc 12.3.0 targeting linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants