ISOBMFF icon indicating copy to clipboard operation
ISOBMFF copied to clipboard

Makefile: fix building on Linux with Clang.

Open ronaldonunez opened this issue 1 year ago • 3 comments

Properly set CC variable to clang++ as it's a C++ project and remove unnecessary compiler and linker flags.

This is similar to https://github.com/DigiDNA/ISOBMFF/pull/17.

ronaldonunez avatar Apr 16 '24 12:04 ronaldonunez

Thanks for the PR.
However, this would break the build on some distributions as libc++ might not be the default C++ library.

There's also no difference between calling clang++ or clang -x c++.
It's just a matter of preferences, as both executables are identical and are just wrappers.

macmade avatar Apr 16 '24 12:04 macmade

You're right about libc++, on Ubuntu 22.04 installing libc++abi-dev did the trick. Maybe we could include that info on README.

But, regarding clang -x c++, building is still breaking with the following error and it's only getting solved when changing CXX to cmake++.

[ ISOBMFF ]> Compiling C++ file [ Release - x86_64 ]: BinaryDataStream.cpp
ISOBMFF/source/BinaryDataStream.cpp:31:10: fatal error: 'fstream' file not found
#include <fstream>
         ^~~~~~~~~
1 error generated.
make[1]: *** [Submodules/makelib/Targets.mk:220: Build/Release/Intermediates/x86_64/BinaryDataStream.cpp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
[ ISOBMFF ]> Compiling C++ file [ Release - x86_64 ]: BinaryFileStream.cpp
ISOBMFF/source/BinaryFileStream.cpp:31:10: fatal error: 'fstream' file not found
#include <fstream>
         ^~~~~~~~~
1 error generated.
make[1]: *** [Submodules/makelib/Targets.mk:220: Build/Release/Intermediates/x86_64/BinaryFileStream.cpp.o] Error 1
make: *** [Submodules/makelib/Targets.mk:68: release] Error 2

ronaldonunez avatar Apr 16 '24 12:04 ronaldonunez

Ok, I don’t mind using clang++ as long as you keep the flags for the C++ standard library.

macmade avatar Apr 16 '24 22:04 macmade