Skip to content

Cannot compile a simple example on Ubuntu #603

Open
@DMarkD

Description

@DMarkD

C++ compiler version: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Hazelcast Cpp client version: 3.12.1
Hazelcast server version:
Number of the clients:1
Cluster size, i.e. the number of Hazelcast cluster members:
OS version (Windows/Linux/OSX):Linux

Example program taken from https://github.com/hazelcast/hazelcast-cpp-client/tree/master/examples/distributed-map :

#include <hazelcast/client/HazelcastClient.h>
int main() {
hazelcast::client::HazelcastClient hz;
auto map = hz.getMap("map");
return 0;
}

Steps to reproduce the behaviour

g++ -w main.cpp -pthread -I./external/include -I./hazelcast/include -L./hazelcast/lib -lHazelcastClient3.12.1_64

Errors:
main.cpp: In function ‘int main()’:
main.cpp:6:28: error: no matching function for call to ‘hazelcast::client::HazelcastClient::getMap(const char [4])’
auto map = hz.getMap("map");
^
In file included from main.cpp:1:0:
./hazelcast/include/hazelcast/client/HazelcastClient.h:437:24: note: candidate: template<class K, class V> hazelcast::client::IMap<K, V> hazelcast::client::HazelcastClient::getMap(const string&)
IMap<K, V> getMap(const std::string &name) {
^~~~~~
./hazelcast/include/hazelcast/client/HazelcastClient.h:437:24: note: template argument deduction/substitution failed:
main.cpp:6:28: note: couldn't deduce template parameter ‘K’
auto map = hz.getMap("map");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions