Some compiling needs proper path to header (include) files and shared librararies *.so or archive files (.a).
So to be more specific compiling e.g. indi/examples/tutorial_three/simpleccd.cpp
$ g++ simpleccd.cpp -o simpleccd -I/usr/include/libindi -lindiclient -lindidriver && file simpleccd
simpleccd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=94b50e8cba51f2f174afab03cc6e7a986f3606e4, for GNU/Linux 3.2.0, not stripped
Or e.g.
indi/examples/tutorial_seven
$g++ simple_telescope_simulator.cpp -o simple_telescope_simulator -I/usr/include/libindi -lindiclient -lindidriver && file simple_telescope_simulator
/usr/bin/ld: /tmp/ccESuSgI.o: undefined reference to symbol 'ln_get_julian_from_sys'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnova-0.16.so.0: error adding symbols: DSO missing from command line
complains that libnova is missing, so adding the proper library as an additional parameter "-llibnova" (requires libnova packaged install) and in addition it requires