filmulator-gui icon indicating copy to clipboard operation
filmulator-gui copied to clipboard

0.11.0 failing to compile on macos 10.13.6

Open jamiecollinson opened this issue 3 years ago • 3 comments

Apologies if this is a simple one. C++ isn't my daily language, so I'm familiar enough to have worked through the requirements, and thought I'd test this out on my system locally before trying to setup a macOS CI, but have hit the following error in compilation which has me stumped:

Undefined symbols for architecture x86_64:
  "_archive_read_free", referenced from:
      lensfun_dbupdate(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in lensfun_dbupdate.cpp.o
  "_archive_read_support_filter_all", referenced from:
      lensfun_dbupdate(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in lensfun_dbupdate.cpp.o
  "_archive_write_free", referenced from:
      lensfun_dbupdate(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in lensfun_dbupdate.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [filmulator.app/Contents/MacOS/filmulator] Error 1
make[1]: *** [CMakeFiles/filmulator.dir/all] Error 2
make: *** [all] Error 2

I guess this is an issue with libarchive, I'm currently using the latest from brew install (3.5.1_1) but have also tried the version referenced in the readme (3.4.3). Here's my cmake instruction in case it helps:

cmake -DCMAKE_BUILD_TYPE="RELEASE" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_FLAGS=-I/opt/local/include -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp /usr/local/Cellar/libomp/11.0.1/lib/libomp.dylib -I/opt/local/include" -DOpenMP_CXX_LIB_NAMES="libomp" -DOpenMP_libomp_LIBRARY=/usr/local/Cellar/libomp/11.0.1/lib/libomp.dylib -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_SHARED_LINKER_FLAGS=-L/opt/local/lib -DCMAKE_PREFIX_PATH=$(echo $QT/lib/cmake/* | sed -Ee 's$ $;$g') -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=1 -DLibArchive_INCLUDE_DIR=/usr/local/Cellar/libarchive/3.5.1_1/include -Dlibrtprocess_dylib=/opt/local/lib/librtprocess.0.0.1.dylib ..

jamiecollinson avatar Jan 28 '21 12:01 jamiecollinson

https://github.com/hydrogen-music/hydrogen/issues/206

Someone dug this up, it seems to be related. You may have to point cmake directly at the dylib?

CarVac avatar Jan 28 '21 14:01 CarVac

Thanks for the pointer, I'd missed the -DLibArchive_LIBRARY flag which worked.

For reference my cmake command ended up as:

cmake -DCMAKE_BUILD_TYPE="RELEASE" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_FLAGS=-I/opt/local/include -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp /usr/local/Cellar/libomp/11.0.1/lib/libomp.dylib -I/opt/local/include" -DOpenMP_CXX_LIB_NAMES="libomp" -DOpenMP_libomp_LIBRARY=/usr/local/Cellar/libomp/11.0.1/lib/libomp.dylib -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_SHARED_LINKER_FLAGS=-L/opt/local/lib -DCMAKE_PREFIX_PATH=$(echo $QT/lib/cmake/* | sed -Ee 's$ $;$g') -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=1 -DLibArchive_LIBRARY=/usr/local/Cellar/libarchive/3.5.1_1/lib/libarchive.dylib -DLibArchive_INCLUDE_DIR=/usr/local/Cellar/libarchive/3.5.1_1/include -Dlibrtprocess_dylib=/opt/local/lib/librtprocess.0.0.1.dylib ..

jamiecollinson avatar Jan 28 '21 14:01 jamiecollinson

If you have any changes to make to the readme build instructions, feel free to make a pull request.

CarVac avatar Jan 28 '21 14:01 CarVac