-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
v3.0.0 linux compilation error due to: "undefined reference to `clock_gettime'" #2453
Comments
good find, good fix. that's a fairly old GCC, but we ought work with it. what distro is this, just for my edification? your fix looks pretty much right. would you like to make a PR out of it, so you get the commit credit? if not, i'll commit it myself. |
sure enough, " Link with -lrt (only for glibc versions before 2.17)." |
we actually needed it a few more places, and the desired syntax was a bit different. i believe i've fixed this in b5ccc9d; please verify and let me know! thanks! |
Thanks for the quick reply and speedy fix. With b5ccc9d things mostly work but I also needed: diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5ed5c171..af94f8fb4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -599,6 +599,7 @@ target_include_directories(notcurses-info
target_link_libraries(notcurses-info
PRIVATE
notcurses
+ "${LIBRT}"
)
############################################################################
@@ -616,6 +617,8 @@ target_include_directories(notcurses-input
target_link_libraries(notcurses-input
PRIVATE
notcurses++
+ "${LIBRT}"
+
)
############################################################################
@@ -633,6 +636,7 @@ target_include_directories(nctetris
target_link_libraries(nctetris
PRIVATE
notcurses++
+ "${LIBRT}"
)
endif()
@@ -678,6 +682,7 @@ target_include_directories(ncneofetch
target_link_libraries(ncneofetch
PRIVATE
notcurses
+ "${LIBRT}"
)
# documentation source, processed by pandoc into XHTML and man pages. declare
For context, this came up on a synthetic Alpine linux system which only purpose is to cross-compile libraries to a large number of architectures for use by the Julia Language package manager to deliver binaries to users. It is using an old glibc is to try get maximum compatibility with a large variety of users system, since a binary compiled on an older glibc will work on a system with a newer one but not vice versa. If you are at all interested the system is described shortly in https://youtu.be/S__x3K31qnE?t=264 and you can see the WIP for building notcurses with it in JuliaPackaging/Yggdrasil#4059 where it is built for:
Looking at the builders in JuliaPackaging/Yggdrasil#4059, the current status seems to be that it builds on most platforms with the exception of: Apple M1 (aarch64-apple-darwin):
Windows (this one is funny,
FreeBSD - |
outstanding, thanks for all the info. the libdeflate one is surprising -- i use libdeflate in MSYS2 without issues. |
thanks Kristoffer Carlsson <kcarlsson89@gmail.com>!
i've applied your patch from above, and hopefully this solves all remaining problems. thanks a ton! |
thanks Kristoffer Carlsson <kcarlsson89@gmail.com>!
I am getting the following error when attempting to compile v3.0.0 on a linux machine (GCC 7.1.0):
Doing something like:
seems to fix it, but I am not experienced enough to know if that makes sense.
The text was updated successfully, but these errors were encountered: