I’m not very experienced at Linux development, so please be kind
I’m trying to link with libtiff.a (static library) which is in /usr/local/lib
I have this in my CMakeLists.txt:
# Link with other targets.
target_link_libraries(DeepSkyStacker PRIVATE
Qt6::Core
Qt6::Widgets
Qt6::Network
DeepSkyStackerKernel
libraw
ZClass
)
if(WIN32)
target_link_libraries(DeepSkyStacker PRIVATE
libtiff
)
endif()
if(WIN32)
set(DEBUG_DEPENDENCIES exiv2d zlibstaticd)
set(RELEASE_DEPENDENCIES exiv2 zlibstatic)
else()
set(DEBUG_DEPENDENCIES libtiff.a exiv2 expat libz.a)
set(RELEASE_DEPENDENCIES libtiff.a exiv2 expat libz.a)
endif()
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"$<$<CONFIG:Debug>:${DEBUG_DEPENDENCIES}>"
"$<$<CONFIG:Release>:${RELEASE_DEPENDENCIES}>"
"cfitsio"
)
if(WIN32)
set(ADDITIONAL_LIBRARY_DEPENDENCIES ${ADDITIONAL_LIBRARY_DEPENDENCIES}
user32
psapi
htmlhelp
)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
when I try to link I get:
[32/32] Linking CXX executable DeepSkyStacker/DeepSkyStacker
FAILED: DeepSkyStacker/DeepSkyStacker
: && /usr/bin/c++ -g DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/DeepSkyStacker_autogen/mocs_compilation.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/About.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ExplorerBar.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/processingcontrols.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ProcessingDlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ProcessingSettingsDlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/RGBTab.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/SavePicture.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/StarMaskDlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/AskRegistering.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/RegisterSettings.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/AlignmentParameters.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/CometStacking.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/IntermediateFiles.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/OutputTab.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/PostCalibration.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/RawDDPSettings.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ResultParameters.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/StackingParameters.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/StackSettings.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/BackgroundOptions.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/BatchStacking.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/CheckAbove.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/DropFilesDlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/ImageProperties.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/picturelist.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/RecommendedSettings.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/RenameGroup.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/SaveEditChanges.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/StackingDlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/StackRecap.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/lowerdockwidget.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/BaseDialog.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/DeepSkyStacker.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/Delaunay.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/editstars.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/progressdlg.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/selectrect.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/toolbar.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/__/Tools/imageview.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/__/Tools/QElidedLabel.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/__/Tools/QLinearGradientCtrl.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/DeepSkyStacker_autogen/O3VI4VFR3H/qrc_translations.cpp.o DeepSkyStacker/CMakeFiles/DeepSkyStacker.dir/DeepSkyStacker_autogen/EWIEGA46WW/qrc_resources.cpp.o -o DeepSkyStacker/DeepSkyStacker -Wl,-rpath,/opt/Qt/6.8.0/gcc_64/lib: DeepSkyStackerKernel/libDeepSkyStackerKernel.a LibRaw/buildfiles/liblibraw.a ZClass/libZClass.a -Wl,-Bstatic -ltiff -Wl,-Bdynamic -lexiv2 -lexpat -Wl,-Bstatic -lz -Wl,-Bdynamic -lcfitsio /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6.8.0 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6.8.0 -llibtiff -Wl,-rpath-link,/opt/Qt/6.8.0/gcc_64/lib && :
/usr/bin/ld: cannot find -llibtiff: No such file or directory
/usr/bin/ld: note to link with /usr/local/lib/libtiff.a use -l:libtiff.a or rename it to liblibtiff.a
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I imagine I’ve made a classic beginner’s mistake, but what is it please?
Thanks
David