×

INDI Library v1.9.3 Released (11 Nov 2021)

Bimonthly Stable INDI Library release introduces new drivers and fixes for existing ones. Some highlights:

can't compile baseclient.cpp

  • Posts: 13
  • Thank you received: 1
Hi!

today I wanted to compile the baseclient github.com/indilib/indi/blob/master/libs...ibase/baseclient.cpp to make a .so to embed in another code. It seems I can't get it to compile as I get these errors:
In file included from /home/matt/data/indi/indi/libs/indibase/baseclient.h:23,
                 from /home/matt/data/indi/indi/libs/indibase/baseclient.cpp:21:
/home/matt/data/indi/indi/libs/indibase/indibase.h:80:13: note: previous definition of ‘class INDI::BaseMediator’
   80 | class INDI::BaseMediator
      |             ^~~~~~~~~~~~
In file included from /home/matt/data/indi/indi/libs/indibase/indiutility.h:29,
                 from /home/matt/data/indi/indi/libs/indibase/basedevice.h:23,
                 from /home/matt/data/indi/indi/libs/indibase/baseclient.cpp:25:
/home/matt/data/indi/indi/libs/indibase/indimacros.h:104:18: error: redefinition of ‘template<class T> T* getPtrHelper(T*)’
  104 | static inline T *getPtrHelper(T *ptr) { return ptr; }
      |                  ^~~~~~~~~~~~
 

I am not sure if this is the correct way, but looking at pyindi it seems to me it does something very similar to create the package. I also looked through my entire filesystem and I couldn't find any trace of such a shared object (but there is a libindiclient.a) how can I achieve my goal?
4 months 2 weeks ago #73713

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

How are you including it? using cmake? If you provide a sample, we can probably help.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
4 months 1 week ago #73842

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

  • Posts: 13
  • Thank you received: 1

Replied by Mattia on topic can't compile baseclient.cpp

I am using the following command with g++
g++ -w -c -fPIC -I /usr/include/libindi/ -I /home/matt/data/indi/indi/ -I /home/matt/data/indi/indi/libs/ /home/matt/data/indi/indi/libs/indibase/baseclient.cpp -o ./indiclient.o
4 months 1 week ago #73922

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

The client depends on a lot of sources. Look at CMakeListst.txt for example:
SET(indiclient_C_SRC
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/lilxml.c
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/userio.c
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indiuserio.c
    ${CMAKE_CURRENT_SOURCE_DIR}/base64.c)
 
SET(indiclient_CXX_SRC
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/libastro.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/basedevice.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclient.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperty.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperties.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertybasic.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertytext.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertynumber.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyswitch.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertylight.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyblob.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyview_client.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indistandardproperty.cpp)

You can use CMake to locate INDI and link your application to the client library. For example,

find_package(INDI REQUIRED)
find_package(Nova REQUIRED)
target_link_libraries(myapp ${INDI_CLIENT_LIBRARIES} ${NOVA_LIBRARIES})
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You: Mattia
4 months 1 week ago #73932

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

  • Posts: 13
  • Thank you received: 1

Replied by Mattia on topic can't compile baseclient.cpp

thanks for your input Jasem! with a bit of magic I was able to compile a .so!
4 months 1 week ago #73956

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

Time to create page: 0.540 seconds