I am trying to compile admesh found here
https://github.com/admesh/admesh
I am following thier install instructions which basically is configure and make. But when i run the make command in my mac, its giving the following error,
MacBook-Pro:admesh mk$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
CC connect.lo
CC normals.lo
CC shared.lo
CC stlinit.lo
CC stl_io.lo
CC util.lo
CCLD libadmesh.la
ld: unknown option: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libadmesh.la] Error 1
make: *** [all] Error 2
MacBook-Pro:admesh mk$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
Can anyone help me to fix this error.
Apple ships the clang/LLVM compiler with macOS. Clang is a "front-end" that can parse C , C++ and Objective-C down to something that LLVM (referred to as a "back-end") can compile. Clang/LLVM is located in /Applications/Xcode. app/somewhere.
From Xcode 4.2, Clang is the default compiler for Mac OS X.
First you get the error because the compiler can not find the definition of the power function that you are using. Even if you write int power(int m, int n); There is an error because you are not defining the function.
I got this fixed with help of hroncok of admesh.
You need to after configure command, in Makefile.in replace line number 351,352 from
-Wl,--gc-sections \
-Wl,--as-needed \
to
-Wl,-dead_strip \
-Wl,-dead_strip \
and fixed the error as per your hroncok suggestion. Look here for more details https://github.com/admesh/admesh/issues/7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With