CESNET / libnetconf2

C NETCONF library
BSD 3-Clause "New" or "Revised" License
200 stars 144 forks source link

clang erro #441

Open gicfgg opened 10 months ago

gicfgg commented 10 months ago

while make after cmake ..successed, there is erro occured

ld: Undefined symbols: _pthread_rwlock_timedrdlock, referenced from: _pthread_rwlock_clockrdlock in compat.c.o _pthread_rwlock_timedwrlock, referenced from: _pthread_rwlock_clockwrlock in compat.c.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

and i 'm using a mac

The C compiler identification is AppleClang 15.0.0.15000040

michalvasko commented 10 months ago

Please provide the output of cmake, having no prior CMake cache (empty build directory).

gicfgg commented 10 months ago

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The C compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done CMake Warning at CMakeLists.txt:177 (message): valgrind executable not found! Disabling memory leaks tests.

-- Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) (Required is at least version "1.0.1") -- Disabling tests because of missing CMocka -- Could NOT find Uncrustify (missing: UNCRUSTIFY) (Required is at least version "0.77") -- Looking for _POSIX_TIMERS -- Looking for _POSIX_TIMERS - found -- Looking for pthread_mutex_timedlock -- Looking for pthread_mutex_timedlock - not found -- Looking for pthread_mutex_clocklock -- Looking for pthread_mutex_clocklock - not found -- Looking for pthread_rwlock_clockrdlock -- Looking for pthread_rwlock_clockrdlock - not found -- Looking for pthread_rwlock_clockwrlock -- Looking for pthread_rwlock_clockwrlock - not found -- Looking for pthread_cond_clockwait -- Looking for pthread_cond_clockwait - not found -- Looking for vdprintf -- Looking for vdprintf - found -- Looking for asprintf -- Looking for asprintf - not found -- Looking for vasprintf -- Looking for vasprintf - not found -- Looking for getline -- Looking for getline - found -- Looking for strndup -- Looking for strndup - found -- Looking for strnstr -- Looking for strnstr - not found -- Looking for strdupa -- Looking for strdupa - not found -- Looking for strchrnul -- Looking for strchrnul - not found -- Looking for get_current_dir_name -- Looking for get_current_dir_name - not found -- Looking for stdatomic.h -- Looking for stdatomic.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE
-- Looking for pthread_rwlockattr_setkind_np -- Looking for pthread_rwlockattr_setkind_np - not found -- Found OpenSSL: /opt/homebrew/lib/libcrypto.dylib (found version "3.1.3")
-- OpenSSL found, required for TLS -- Found LibSSH: /opt/homebrew/include (found suitable version "0.10.5", minimum required is "0.7.1") -- Found LibPAM: /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/lib/libpam.tbd
-- LibPAM found, version < 1.4, disabled PAM tests -- Found LibYANG: /usr/local/lib/libyang.dylib (found suitable version "2.41.0", minimum required is "2.28.0") -- Looking for shadow.h -- Looking for shadow.h - not found -- Looking for crypt.h -- Looking for crypt.h - not found -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Configuring done (4.3s) -- Generating done (0.0s) -- Build files have been written to: /Users/sunxiaoyan/Documents/for-netopeer/libnetconf2-2.1.37/build

thankyou

michalvasko commented 10 months ago

You can try using the latest devel, this particular problem should be fixed. However, I am not sure you will not encounter another compilation problem and even if not, I doubt libnetconf2 will work correctly simply because MacOS is not officially supported.