monero-lws
monero-lws copied to clipboard
Clang build issue: Undefined symbols for architecture x86_64 _IOPSGetTimeRemainingEstimate
Sorry for spamming issues, but after solving the first two issues and adding openssl include dir to INTERFACE_INCLUDE_DIRECTORIES I get the following:
[ 84%] Linking CXX executable monero-lws-admin
Undefined symbols for architecture x86_64:
"_IOPSGetTimeRemainingEstimate", referenced from:
cryptonote::miner::background_worker_thread() in libcryptonote_basic.a(miner.cpp.o)
cryptonote::miner::on_battery_power() in libcryptonote_basic.a(miner.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/monero-lws-admin] Error 1
make[1]: *** [src/CMakeFiles/monero-lws-admin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 665e29c..0a9283d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,6 +151,10 @@ foreach (LIB ${MONERO_LIBRARIES})
unset(LIB_PATH CACHE)
endforeach()
+if (APPLE)
+ list(APPEND IMPORTED_MONERO_LIBRARIES "-framework IOKit")
+endif()
+
add_library(monero::libraries INTERFACE IMPORTED)
set_property(TARGET monero::libraries PROPERTY
INTERFACE_INCLUDE_DIRECTORIES
solves this for me, though I’m not sure if this is the right way to add this framework.
This worked for me too.