You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libhello/lib/libhello.so is a simple library that print "hello", hello.c and libhello/BUILD code as follows. Compiled with gcc -shared -o libhello.so src/hello.c -Iinclude
libhello_again is another library that use the function say_hello from libhello. libhello_again/hello_again.c and libhello_again/BUILD code as follows:
My question is: after build with bazel build //..., bazel-bin/libhello_again/libhello_again.so is compiled, but ldd bazel-bin/libhello_again/libhello_again.so shows no link to libhello.so, and nm shows that say_hello is a Undefined symbol.
➜ bazel_help ✗ ldd bazel-bin/libhello_again/libhello_again.so
linux-vdso.so.1 (0x000076d8f7b82000)
libc.so.6 => /usr/lib/libc.so.6 (0x000076d8f7946000)
/usr/lib64/ld-linux-x86-64.so.2 (0x000076d8f7b84000)
➜ bazel_help ✗ nm bazel-bin/libhello_again/libhello_again.so | grep U
U puts
U say_hello
Any suggestions would be very helpful, Thanks a lot.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
gcc -shared -o libhello.so src/hello.c -Iinclude
bazel build //...
, bazel-bin/libhello_again/libhello_again.so is compiled, butldd bazel-bin/libhello_again/libhello_again.so
shows no link to libhello.so, and nm shows that say_hello is a Undefined symbol.Beta Was this translation helpful? Give feedback.
All reactions