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

shell_app build error in ubuntu20 #13

Open
chengxuewen opened this issue May 16, 2024 · 0 comments
Open

shell_app build error in ubuntu20 #13

chengxuewen opened this issue May 16, 2024 · 0 comments

Comments

@chengxuewen
Copy link

chengxuewen commented May 16, 2024

[cmake] -- sqlite-amalgamation-3.38.2 configure success
[cmake] [1/5] Building C object CMakeFiles/shell_app.dir/shell.c.o
[cmake] [2/5] Building C object CMakeFiles/SQLite3.dir/sqlite3.c.o
[cmake] [3/5] Linking C static library libsqlite3.a
[cmake] [4/5] Linking C executable sqlite3
[cmake] FAILED: sqlite3
[cmake] : && /usr/bin/cc -O3 -DNDEBUG CMakeFiles/shell_app.dir/shell.c.o -o sqlite3 libsqlite3.a -lpthread -ldl && cd /home/ubuntu/Documents/sqlite-amalgamation-3.38.2/build && /usr/bin/strip sqlite3
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o): in function logFunc': [cmake] sqlite3.c:(.text+0x196ed): undefined reference to log'
[cmake] /usr/bin/ld: sqlite3.c:(.text+0x1971d): undefined reference to log' [cmake] /usr/bin/ld: sqlite3.c:(.text+0x19781): undefined reference to log'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1370): undefined reference to trunc' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1520): undefined reference to exp'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1568): undefined reference to pow' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x15b0): undefined reference to pow'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x15f8): undefined reference to fmod' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1640): undefined reference to acos'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1688): undefined reference to asin' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x16d0): undefined reference to atan'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1718): undefined reference to atan2' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1760): undefined reference to cos'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x17a8): undefined reference to sin' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x17f0): undefined reference to tan'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1838): undefined reference to cosh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1880): undefined reference to sinh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x18c8): undefined reference to tanh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1910): undefined reference to acosh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1958): undefined reference to asinh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x19a0): undefined reference to atanh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x19e8): undefined reference to `sqrt'
[cmake] collect2: error: ld returned 1 exit status
[cmake] ninja: build stopped: subcommand failed.
[cmake] -- Configuring incomplete, errors occurred!

fd4f85218e7c46289d38d6fc154fe0d6

need add -lm in target_link_libraries function.
if(UNIX)
target_link_libraries(shell_app PRIVATE -lm)
endif()

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