From 579e2c7b92b8877a1df6c35eab7b9238e87cfef6 Mon Sep 17 00:00:00 2001 From: Dimitri Rusin Date: Tue, 14 Nov 2023 15:56:41 +0100 Subject: [PATCH] make function inline so that the symbol does not get defined several times. According to the error message: /home/runner/work/IOHexperimenter/IOHexperimenter/include/ioh/common/file.hpp:115: multiple definition of `ioh::common::file::utils::get_static_root[abi:cxx11]()'; CMakeFiles/test_ioh.dir/cpp/common/test_common.cpp.o:/home/runner/work/IOHexperimenter/IOHexperimenter/include/ioh/common/file.hpp:115: first defined here There are actually at least .cpp files that are merged together before compilation, that both include this file.hpp. --- include/ioh/common/file.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ioh/common/file.hpp b/include/ioh/common/file.hpp index c5003c37..25484141 100644 --- a/include/ioh/common/file.hpp +++ b/include/ioh/common/file.hpp @@ -111,7 +111,7 @@ namespace ioh::common::file * * @return fs::path the absolute path of IOHexperimenter/static */ - fs::path get_static_root() + inline fs::path get_static_root() { // Print the contents of the current, previous, and the one before previous directories print_directory_contents(fs::current_path());