Skip to content

i need urgent help #111

@frkn4129

Description

@frkn4129

I couldn't uninstall the project.
$ mkdir build .
$ cd build
$ cmake ..
$ make
i made this. Next step
myexampleCode
examp.cpp
#include <clickhouse/client.h>
using namespace clickhouse;
int main (){
/// Initialize client connection.
Client client(ClientOptions().SetHost("localhost"));

/// Create a table.
client.Execute("CREATE TABLE IF NOT EXISTS test.ips (id UInt64, v4 IPv4, v6 IPv6) ENGINE = Memory");

/// Insert some values.
try {
Block block;

auto id = std::make_shared<ColumnUInt64>();
id->Append(1);
id->Append(7);

auto name = std::make_shared<ColumnString>();
name->Append("one");
name->Append("seven");

block.AppendColumn("test id"  , id);
block.AppendColumn("name", name);

client.Insert("test.numbers", block);

} catch (std::exception &e) {
printf("Error: %s\n", e.what());
}

return 0 ;
}
i am run this -> g++ -std=c++17 examp.cpp

the error i got :
/usr/bin/ld: /tmp/ccgnim45.o: in function main': examp.cpp:(.text+0x1bf): undefined reference to clickhouse::Client::Client(clickhouse::ClientOptions const&)'
/usr/bin/ld: examp.cpp:(.text+0x202): undefined reference to clickhouse::Query::Query(char const*)' /usr/bin/ld: examp.cpp:(.text+0x21b): undefined reference to clickhouse::Client::Execute(clickhouse::Query const&)'
/usr/bin/ld: examp.cpp:(.text+0x22a): undefined reference to clickhouse::Query::~Query()' /usr/bin/ld: examp.cpp:(.text+0x239): undefined reference to clickhouse::Block::Block()'
/usr/bin/ld: examp.cpp:(.text+0x277): undefined reference to clickhouse::ColumnVector<unsigned long>::Append(unsigned long const&)' /usr/bin/ld: examp.cpp:(.text+0x2a6): undefined reference to clickhouse::ColumnVector::Append(unsigned long const&)'
/usr/bin/ld: examp.cpp:(.text+0x2f9): undefined reference to clickhouse::ColumnString::Append(std::basic_string_view<char, std::char_traits<char> >)' /usr/bin/ld: examp.cpp:(.text+0x33d): undefined reference to clickhouse::ColumnString::Append(std::basic_string_view<char, std::char_traits >)'
/usr/bin/ld: examp.cpp:(.text+0x3a2): undefined reference to clickhouse::Block::AppendColumn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<clickhouse::Column> const&)' /usr/bin/ld: examp.cpp:(.text+0x434): undefined reference to clickhouse::Block::AppendColumn(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::shared_ptrclickhouse::Column const&)'
/usr/bin/ld: examp.cpp:(.text+0x4ad): undefined reference to clickhouse::Client::Insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, clickhouse::Block const&)' /usr/bin/ld: examp.cpp:(.text+0x4f8): undefined reference to clickhouse::Block::~Block()'
/usr/bin/ld: examp.cpp:(.text+0x50c): undefined reference to clickhouse::Client::~Client()' /usr/bin/ld: examp.cpp:(.text+0x584): undefined reference to clickhouse::Query::~Query()'
/usr/bin/ld: examp.cpp:(.text+0x69b): undefined reference to clickhouse::Block::~Block()' /usr/bin/ld: examp.cpp:(.text+0x720): undefined reference to clickhouse::Client::~Client()'
/usr/bin/ld: /tmp/ccgnim45.o: in function __static_initialization_and_destruction_0(int, int)': examp.cpp:(.text+0x769): undefined reference to clickhouse::NetrworkInitializer::NetrworkInitializer()'
/usr/bin/ld: /tmp/ccgnim45.o: in function void __gnu_cxx::new_allocator<clickhouse::ColumnVector<unsigned long> >::construct<clickhouse::ColumnVector<unsigned long>>(clickhouse::ColumnVector<unsigned long>*)': examp.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN10clickhouse12ColumnVectorImEEE9constructIS3_JEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN10clickhouse12ColumnVectorImEEE9constructIS3_JEEEvPT_DpOT0_]+0x31): undefined reference to clickhouse::ColumnVector::ColumnVector()'
/usr/bin/ld: /tmp/ccgnim45.o: in function void __gnu_cxx::new_allocator<clickhouse::ColumnString>::construct<clickhouse::ColumnString>(clickhouse::ColumnString*)': examp.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN10clickhouse12ColumnStringEE9constructIS2_JEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN10clickhouse12ColumnStringEE9constructIS2_JEEEvPT_DpOT0_]+0x31): undefined reference to clickhouse::ColumnString::ColumnString()'
collect2: error: ld returned 1 exit status

help pls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions