How to add “-l” (ell) compiler flag in CMake

Flag -l is for linker, not for compiler. This flag is used for link with libraries. CMake has special command target_link_libraries for that purpose:

target_link_libraries(day_g pq)

Leave a Comment