c++ - Multiple definiton of function when including library -
i try include headers library in different files of project , multiple definition errors on functions of library. after reading answer this question think problem functions implemented directly in header files of library. in particular want include files codecfactory.h , deltautil.h fastpfor . don't know if relevant problem include cmake project code in cmakelists.txt: include_directories(../../fastpfor/headers) add_library(fastpfor static ../../fastpfor/src/bitpacking.cpp ../../fastpfor/src/bitpacking.cpp ../../fastpfor/src/bitpackingaligned.cpp ../../fastpfor/src/bitpackingunaligned.cpp ../../fastpfor/src/horizontalbitpacking.cpp ../../fastpfor/src/simdunalignedbitpacking.cpp ../../fastpfor/src/simdbitpacking.cpp ${headers} ) everything works fin