×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Trouble Linking Libraries

Actually, I'll do that. I need to write a sample generic client that everyone can re-use in their projects like in your case. Give me a couple of days.
4 years 8 months ago #41823

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 3

Replied by Greg on topic Trouble Linking Libraries

I went ahead and made the minimal project. I think the issue is in the find_package statement. On the github by default it finds the alignment and driver components. To get the client component you need to specify it but when I try to it doesn't find the client component. When the CMake file compiles it notifies me that it has found the driver and alignment components but there is no information on the client component.
4 years 8 months ago #41824
Attachments:

Please Log in or Create an account to join the conversation.

yes, I arrived at the same conclusion. I updated cmake_modules/FindINDI.cmake documentation.

So actually, we still get to use ${INDI_LIBRARIES} as is, but the find_package is different
find_package(INDI COMPONENTS client REQUIRED)

Now the 3rd party generic client is compiling fine. I'll go ahead and write the simple client anyway since it will certainly help prospective developers in jumping into development faster. Thank you for patience on this!
4 years 8 months ago #41826

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 3

Replied by Greg on topic Trouble Linking Libraries

Awesome! This fixed the issue! However, I am now getting a new error in the client library.

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libindiclient.a(basedevice.cpp.o): undefined reference to symbol 'uncompress'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I thought this had to do with a dependency on pthreads and tried including that using

find_package(Threads REQUIRED)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(pandaScope ${CMAKE_THREAD_LIBS_INIT})

but that didn't work. Thanks for working so hard on solving this issue. I really appreciate the help!
4 years 8 months ago #41829

Please Log in or Create an account to join the conversation.

yeah, just add z to the end:
target_link_libraries(indi_generic_client ${INDI_LIBRARIES} ${NOVA_LIBRARIES} z)

or you can add another find_package(ZLIB REQUIRED) and maybe add ${ZLIB_LIBRARY} instead of z.
4 years 8 months ago #41837

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 3

Replied by Greg on topic Trouble Linking Libraries

Fixed the issue. For the client to work correctly, these must be included in the CMakeLists.txt file

find_package(INDI 1.7 REQUIRED)
find_package(INDI COMPONENTS client REQUIRED)
find_package(Nova REQUIRED)
find_package(CFITSIO REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)

include_directories(${INDI_INCLUDE_DIR})
include_directories(${NOVA_INCLUDE_DIR})
include_directories(${CFITSIO_INCLUDE_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${ZLIB_INCLUDE_DIR})

target_link_libraries(pandaScope ${NOVA_LIBRARIES})
target_link_libraries(pandaScope ${CFITSIO_LIBRARIES})
target_link_libraries(pandaScope ${INDI_LIBRARIES})
target_link_libraries(pandaScope ${INDI_CLIENT_LIBRARIES})
target_link_libraries(pandaScope ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(pandaScope ${ZLIB_LIBRARIES})

Thanks for all your help Jasem!
The following user(s) said Thank You: Jasem Mutlaq
4 years 8 months ago #41838

Please Log in or Create an account to join the conversation.

Time to create page: 0.450 seconds