TulipCharts / tulipindicators

Technical Analysis Indicator Function Library in C
https://tulipindicators.org/
GNU Lesser General Public License v3.0
850 stars 158 forks source link

MacbookPro m1 build failed!!!! #121

Closed UnivexDont closed 1 year ago

UnivexDont commented 1 year ago

When build with m1 MackBookPro ,I got a error!!!!

ar rcu libindicators.a indicators.h candles.h indicators.c candles.c indicators/abs.o indicators/acos.o indicators/ad.o indicators/add.o indicators/adosc.o indicators/adx.o indicators/adxr.o indicators/ao.o indicators/apo.o indicators/aroon.o indicators/aroonosc.o indicators/asin.o indicators/atan.o indicators/atr.o indicators/avgprice.o indicators/bbands.o indicators/bop.o indicators/cci.o indicators/ceil.o indicators/cmo.o indicators/cos.o indicators/cosh.o indicators/crossany.o indicators/crossover.o indicators/cvi.o indicators/decay.o indicators/dema.o indicators/di.o indicators/div.o indicators/dm.o indicators/dpo.o indicators/dx.o indicators/edecay.o indicators/ema.o indicators/emv.o indicators/exp.o indicators/fisher.o indicators/floor.o indicators/fosc.o indicators/hma.o indicators/kama.o indicators/kvo.o indicators/lag.o indicators/linreg.o indicators/linregintercept.o indicators/linregslope.o indicators/ln.o indicators/log10.o indicators/macd.o indicators/marketfi.o indicators/mass.o indicators/max.o indicators/md.o indicators/medprice.o indicators/mfi.o indicators/min.o indicators/mom.o indicators/msw.o indicators/mul.o indicators/natr.o indicators/nvi.o indicators/obv.o indicators/ppo.o indicators/psar.o indicators/pvi.o indicators/qstick.o indicators/roc.o indicators/rocr.o indicators/round.o indicators/rsi.o indicators/sin.o indicators/sinh.o indicators/sma.o indicators/sqrt.o indicators/stddev.o indicators/stderr.o indicators/stoch.o indicators/stochrsi.o indicators/sub.o indicators/sum.o indicators/tan.o indicators/tanh.o indicators/tema.o indicators/todeg.o indicators/torad.o indicators/tr.o indicators/trima.o indicators/trix.o indicators/trunc.o indicators/tsf.o indicators/typprice.o indicators/ultosc.o indicators/var.o indicators/vhf.o indicators/vidya.o indicators/volatility.o indicators/vosc.o indicators/vwma.o indicators/wad.o indicators/wcprice.o indicators/wilders.o indicators/willr.o indicators/wma.o indicators/zlema.o utils/buffer.o indicators.o candles.o
ranlib libindicators.a
gcc -c -Wall -Wextra -Wshadow -Wconversion -std=c99 -pedantic -O2 -g sample.c -o sample.o
gcc -Wall -Wextra -Wshadow -Wconversion -std=c99 -pedantic -O2 -g -o sample sample.o libindicators.a -lm
ld: warning: ignoring file libindicators.a, building for macOS-arm64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture arm64:
  "_ti_find_indicator", referenced from:
      _main in sample.o
  "_ti_indicators", referenced from:
      _main in sample.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sample] Error 1
codeplea commented 1 year ago

Is there any particular reason you're not using make?

I think your issues is that you're not compiling indicators.c and candles.c before passing to ar on the first command line. Also, passing in the .h files to ar shouldn't be necessary.

Alternatively, you can just use tiamalgamation.c. e.g. gcc tiamalgamation.c sample.c -o sample