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

c bindings missing symbols? #1913

Open
sirus20x6 opened this issue Jan 11, 2025 · 0 comments
Open

c bindings missing symbols? #1913

sirus20x6 opened this issue Jan 11, 2025 · 0 comments

Comments

@sirus20x6
Copy link

so I built with cargo xtask build

I appear to have some stuff built


> ls -la ./libs/libsql/libsql-sqlite3/.libs/
total 31484
drwxr-xr-x 1 sirus sirus     500 Jan 10 21:43 .
drwxr-xr-x 1 sirus sirus    1620 Jan 10 22:03 ..
-rw-r--r-- 1 sirus sirus 7285398 Jan 10 21:43 liblibsql.a
lrwxrwxrwx 1 sirus sirus      15 Jan 10 21:43 liblibsql.la -> ../liblibsql.la
-rw-r--r-- 1 sirus sirus     941 Jan 10 21:43 liblibsql.lai
lrwxrwxrwx 1 sirus sirus      18 Jan 10 21:43 liblibsql.so -> liblibsql.so.0.8.6
lrwxrwxrwx 1 sirus sirus      18 Jan 10 21:43 liblibsql.so.0 -> liblibsql.so.0.8.6
-rwxr-xr-x 1 sirus sirus 5132080 Jan 10 21:43 liblibsql.so.0.8.6
-rw-r--r-- 1 sirus sirus 7285398 Jan 10 21:43 libsqlite3.a
lrwxrwxrwx 1 sirus sirus      16 Jan 10 21:43 libsqlite3.la -> ../libsqlite3.la
-rw-r--r-- 1 sirus sirus     948 Jan 10 21:43 libsqlite3.lai
lrwxrwxrwx 1 sirus sirus      19 Jan 10 21:43 libsqlite3.so -> libsqlite3.so.0.8.6
lrwxrwxrwx 1 sirus sirus      19 Jan 10 21:43 libsqlite3.so.0 -> libsqlite3.so.0.8.6
-rwxr-xr-x 1 sirus sirus 5132080 Jan 10 21:43 libsqlite3.so.0.8.6
-rw-r--r-- 1 sirus sirus  213336 Jan 10 21:43 libtclsqlite3.a
lrwxrwxrwx 1 sirus sirus      19 Jan 10 21:43 libtclsqlite3.la -> ../libtclsqlite3.la
-rw-r--r-- 1 sirus sirus    1021 Jan 10 21:43 libtclsqlite3.lai
-rwxr-xr-x 1 sirus sirus  196464 Jan 10 21:43 libtclsqlite3.so
-rw-r--r-- 1 sirus sirus 6735464 Jan 10 21:43 sqlite3.o
-rw-r--r-- 1 sirus sirus  206992 Jan 10 21:42 tclsqlite.o

but checking with nm none of those libraries seem to contain libsql_open_ext

> cmake --build .
[ 33%] Built target libsql_build
[ 66%] Linking CXX executable langchain_test
/usr/bin/ld: CMakeFiles/langchain_test.dir/src/main.cpp.o: in function `main':
main.cpp:(.text+0x54): undefined reference to `libsql_open_ext'
/usr/bin/ld: main.cpp:(.text+0xe3): undefined reference to `libsql_connect'
/usr/bin/ld: main.cpp:(.text+0x156): undefined reference to `libsql_close'
/usr/bin/ld: main.cpp:(.text+0x181): undefined reference to `libsql_execute'
/usr/bin/ld: main.cpp:(.text+0x1f4): undefined reference to `libsql_disconnect'
/usr/bin/ld: main.cpp:(.text+0x203): undefined reference to `libsql_close'
/usr/bin/ld: main.cpp:(.text+0x24a): undefined reference to `libsql_execute'
/usr/bin/ld: main.cpp:(.text+0x2bd): undefined reference to `libsql_disconnect'
/usr/bin/ld: main.cpp:(.text+0x2cc): undefined reference to `libsql_close'
/usr/bin/ld: main.cpp:(.text+0x2f7): undefined reference to `libsql_execute'
/usr/bin/ld: main.cpp:(.text+0x36a): undefined reference to `libsql_disconnect'
/usr/bin/ld: main.cpp:(.text+0x379): undefined reference to `libsql_close'
/usr/bin/ld: main.cpp:(.text+0x3a8): undefined reference to `libsql_query'
/usr/bin/ld: main.cpp:(.text+0x41b): undefined reference to `libsql_disconnect'
/usr/bin/ld: main.cpp:(.text+0x42a): undefined reference to `libsql_close'
/usr/bin/ld: main.cpp:(.text+0x4b2): undefined reference to `libsql_get_int'
/usr/bin/ld: main.cpp:(.text+0x53d): undefined reference to `libsql_get_string'
/usr/bin/ld: main.cpp:(.text+0x792): undefined reference to `libsql_free_string'
/usr/bin/ld: main.cpp:(.text+0x7b2): undefined reference to `libsql_next_row'
/usr/bin/ld: main.cpp:(.text+0x8a3): undefined reference to `libsql_free_rows'
/usr/bin/ld: main.cpp:(.text+0x8b2): undefined reference to `libsql_disconnect'
/usr/bin/ld: main.cpp:(.text+0x8c1): undefined reference to `libsql_close'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/langchain_test.dir/build.make:102: langchain_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:144: CMakeFiles/langchain_test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I made a little script for checking for everything cmake complains about

> ./test.sh
Checking symbols in libraries within ./libs/libsql/libsql-sqlite3/.libs...
Checking file: ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.a
Checking file: ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/liblibsql.so
Checking file: ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.a
Checking file: ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/libsqlite3.so
Checking file: ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.a
Checking file: ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_open_ext' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_connect' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_close' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_execute' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_disconnect' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_query' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_get_int' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_get_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_free_string' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_next_row' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
  Symbol 'libsql_free_rows' not found in ./libs/libsql/libsql-sqlite3/.libs/libtclsqlite3.so
Symbol check complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant