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

library not found for -lacars-2 - MacOS #112

Open
matta828 opened this issue Oct 4, 2023 · 1 comment · May be fixed by #117
Open

library not found for -lacars-2 - MacOS #112

matta828 opened this issue Oct 4, 2023 · 1 comment · May be fixed by #117

Comments

@matta828
Copy link

matta828 commented Oct 4, 2023

Hi,
I have been trying to compile acarsdec on my Mac and I can get past cmake successfully but I encounter the error

[100%] Linking C executable acarsdec
ld: library not found for -lacars-2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [acarsdec] Error 1
make[1]: *** [CMakeFiles/acarsdec.dir/all] Error 2
make: *** [all] Error 2

when using the make command. From here I am stuck and have no idea how to proceed. According to cmake it actually found libacars no problem, here is the log:

cmake .. -Dairspy=ON
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 <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 14.0.3.14030022
-- 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
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libacars-2>=2.0.0'
--   Found libacars-2, version 2.2.0
-- Using libacars
-- Not using MQTT
-- Using libsnd
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/horaciomatta/SDR/acarsdec/build

Hopefully someone can help me out with this.

Thanks.

@szechyjs
Copy link

I fixed it with the following change...

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33c5f02..afe1fb4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ pkg_check_modules(LIBACARS libacars-2>=2.0.0)
 if(LIBACARS_FOUND)
 message ( STATUS "Using libacars")
 add_definitions(-DHAVE_LIBACARS )
-target_link_libraries(acarsdec ${LIBACARS_LIBRARIES})
+target_link_libraries(acarsdec ${LIBACARS_LINK_LIBRARIES})
 target_include_directories(acarsdec PUBLIC ${LIBACARS_INCLUDE_DIRS})
 link_directories(${LIBACARS_LIBRARY_DIRS})
 else()

f00b4r0 added a commit to f00b4r0/acarsdec that referenced this issue Jul 13, 2024
@f00b4r0 f00b4r0 linked a pull request Aug 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants