nebula-cpp icon indicating copy to clipboard operation
nebula-cpp copied to clipboard

undefined reference to `nebula::ConnectionPool::init

Open chenlinzhong opened this issue 2 years ago • 14 comments

when i try to compile the client some errors happend

[root@xafj-palo-rpm64 examples]# ll /usr/local/nebula/include/nebula/
total 24
drwxr-xr-x 2 root root 4096 Mar 26 08:09 client
drwxr-xr-x 2 root root 4096 Feb  6 06:04 common
drwxr-xr-x 2 root root 4096 Feb  6 06:04 graph
drwxr-xr-x 2 root root 4096 Mar 26 08:09 mclient
drwxr-xr-x 2 root root 4096 Mar 26 08:09 sclient
drwxr-xr-x 2 root root 4096 Feb  6 06:04 storage

[root@xafj-palo-rpm64 examples]# ll /usr/local/nebula/lib64
total 56092
-rwxr-xr-x 1 root root 12853496 Feb  6 06:04 libnebula_graph_client.so
-rwxr-xr-x 1 root root 20857576 Feb  6 06:04 libnebula_meta_client.so
-rwxr-xr-x 1 root root 23719896 Feb  6 06:04 libnebula_storage_client.so
[root@xafj-palo-rpm64 examples]# LIBRARY_PATH=/usr/local/nebula/lib64:$LIBRARY_PATH  g++ -std=c++11 SessionExample.cpp -I/usr/local/nebula/include  -lnebula_graph_client
/tmp/ccOd1hjO.o: In function `main':
SessionExample.cpp:(.text+0x253): undefined reference to `nebula::ConnectionPool::init(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, nebula::Config const&)'
SessionExample.cpp:(.text+0x33c): undefined reference to `nebula::ConnectionPool::getSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
SessionExample.cpp:(.text+0x3e7): undefined reference to `nebula::Session::execute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
SessionExample.cpp:(.text+0x4ef): undefined reference to `nebula::Session::asyncExecute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (nebula::ExecutionResponse&&)>)'
/tmp/ccOd1hjO.o: In function `nebula::operator<<(std::ostream&, nebula::Value const&)':
SessionExample.cpp:(.text._ZN6nebulalsERSoRKNS_5ValueE[_ZN6nebulalsERSoRKNS_5ValueE]+0x2f): undefined reference to `nebula::Value::toString[abi:cxx11]() const'
collect2: error: ld returned 1 exit status

chenlinzhong avatar Mar 26 '23 08:03 chenlinzhong

@Shylock-Hg could you please take a look at it?

wey-gu avatar Mar 27 '23 01:03 wey-gu

Please show the compile options of nebual_graph_client library.

Shylock-Hg avatar Mar 27 '23 01:03 Shylock-Hg

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

chenlinzhong avatar Mar 27 '23 02:03 chenlinzhong

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

Shylock-Hg avatar Mar 27 '23 02:03 Shylock-Hg

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

chenlinzhong avatar Mar 27 '23 02:03 chenlinzhong

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Shylock-Hg avatar Mar 27 '23 02:03 Shylock-Hg

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

chenlinzhong avatar Mar 27 '23 02:03 chenlinzhong

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

ok, you could try https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el8.x86_64.rpm

Shylock-Hg avatar Mar 27 '23 02:03 Shylock-Hg

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

ok, you could try https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el8.x86_64.rpm not ok [root@xafj-palo-rpm64 ~]# rpm -ivh nebula-graph-client-3.4.0.el8.x86_64.rpm error: Failed dependencies: libc.so.6(GLIBC_2.25)(64bit) is needed by nebula-graph-client-3.4.0-1.x86_64

chenlinzhong avatar Mar 27 '23 03:03 chenlinzhong

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

ok, you could try https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el8.x86_64.rpm not ok [root@xafj-palo-rpm64 ~]# rpm -ivh nebula-graph-client-3.4.0.el8.x86_64.rpm error: Failed dependencies: libc.so.6(GLIBC_2.25)(64bit) is needed by nebula-graph-client-3.4.0-1.x86_64

Seems should build nebula-cpp in your environment, try cmake -DCMAKE_BUILD_TYPE=Release

Shylock-Hg avatar Mar 27 '23 03:03 Shylock-Hg

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

ok, you could try https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el8.x86_64.rpm not ok [root@xafj-palo-rpm64 ~]# rpm -ivh nebula-graph-client-3.4.0.el8.x86_64.rpm error: Failed dependencies: libc.so.6(GLIBC_2.25)(64bit) is needed by nebula-graph-client-3.4.0-1.x86_64

do you have docker images that include dependencys so that i can build nebula-cpp from source code directly

chenlinzhong avatar Mar 27 '23 03:03 chenlinzhong

Please show the compile options of nebual_graph_client library.

the nebual_graph_client was downloaded from nebula-cpp ,how can i get the compile options?

Which do you download?

https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el7.x86_64.rpm

What's your version of OS?

Linux 4.14.0_1-0-0-42 #1 SMP Tue Jul 20 16:37:22 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

ok, you could try https://github.com/vesoft-inc/nebula-cpp/releases/download/v3.4.0/nebula-graph-client-3.4.0.el8.x86_64.rpm not ok [root@xafj-palo-rpm64 ~]# rpm -ivh nebula-graph-client-3.4.0.el8.x86_64.rpm error: Failed dependencies: libc.so.6(GLIBC_2.25)(64bit) is needed by nebula-graph-client-3.4.0-1.x86_64

Seems should build nebula-cpp in your environment, try cmake -DCMAKE_BUILD_TYPE=Release

i do this ,but not success, build nebula-third-party occur many errors

chenlinzhong avatar Mar 27 '23 03:03 chenlinzhong

Try with this image https://github.com/vesoft-inc/nebula-dev-docker

export TAG=centos8
docker run -ti \
  -v "$PWD":/home/nebula \
  -w /home/nebula \
  --name nebula_dev \
  vesoft/nebula-dev:$TAG \
  bash

all third-party things are ready there.

wey-gu avatar Mar 27 '23 03:03 wey-gu

@chenlinzhong I encountered this today on a CentOS 7 env that the rpm binary will suffer from issue of yours, too.

I then make instal it from the source to resolve it then.

We should fix the binary install issue @Shylock-Hg .

wey-gu avatar Apr 04 '23 02:04 wey-gu