<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I built a library by <span class="pl-c">Julien Fischer</span> that manages JSON, my issue I think is one of not understanding the linking process!</div><div class=""><br class=""></div><div class="">In my project folder, I have this:</div><div class=""><br class=""></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> ./deps</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> /curl</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> /json</span></font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I built the libcurl from source, that's linking just fine, I am using a Makefile to do it but I think that the option I have used to tell it where the json library can be found must be wrong, here is how I built the library according to the instructions:</div><div class=""><br class=""></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">make INSTALL_PREFIX=/Users/seancharles/Documents/code/mercury/mercury-libcurl/deps/json install</span></font></div><div class=""><br class=""></div><div class="">and sure enough, under my ./deps/json/ folder I have the following:</div><div class=""><br class=""></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">➜ mercury-libcurl ll deps/json/lib/mercury<br class="">total 0<br class="">drwxr-xr-x 12 seancharles staff 384B 30 Aug 08:15 inc<br class="">drwxr-xr-x 75 seancharles staff 2.3K 30 Aug 08:15 ints<br class="">drwxr-xr-x 3 seancharles staff 96B 30 Aug 08:15 lib<br class="">drwxr-xr-x 3 seancharles staff 96B 30 Aug 08:15 modules</span></font></div><div class=""><br class=""></div><div class="">and the leaf folders appear to contain lots of relevant looking code, however when I run the make I get the following linker error:</div><div class=""><br class=""></div><div class=""><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">➜ mercury-libcurl make</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">mmc -s hlc.gc -O4 -E --mld ./deps/json/lib/mercury -lcurl --make mcurl</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">Making mcurl</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">** Error making `mcurl'.</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">Undefined symbols for architecture arm64:</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> "<predicate 'json.from_string'/2 mode 0>", referenced from:</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> <predicate 'main'/2 mode 0> in mcurl.o</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> "<type_ctor_info for type 'json.value'/0>", referenced from:</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""> <predicate 'main'/2 mode 0> in mcurl.o</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">ld: symbol(s) not found for architecture arm64</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">make: *** [mcurl] Error 1</span></font></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">My Makefile is one I use for all my Mercury projects I start, which is where I suspect the issue lies, if anybody can tell me what I need to do I would be very grateful...tomorrow morning I have surgery on my liver to remove Putin, my tumour, and as soon as I wake up, if I can move, I can hack, and ...well, you know... hacking, a great pain killer.</div><div class=""><br class=""></div><div class=""><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">BIN=mcurl</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">DEPS=mcurl.m curl.m</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">FILES=$(patsubst %.m,%,$(DEPS))</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">GENEXT=d,o,mh,err,c,c_date,mh,mih</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">GRADE=hlc.gc</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""># this one links to the extras folder in case you need it.</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""># but note that you may need to change the /usr/local/MERCURY-ROOT/..</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""># FLAGS=--ml posix --mld /usr/local/mercury-rotd-2021-04-15/extras/lib/mercury -s $(GRADE) -O4 -E</span></font></div><div class=""><span style="font-family: APL385;" class="">$CURL_INC=`pkg-config --cflags libcurl`</span></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">$CURL_LIB=`pkg-config --libs libcurl`</span></font></div><div class=""><span style="font-family: APL385;" class="">FLAGS=-s $(GRADE) -O4 -E $(CURL_INC) --mld ./deps/json/lib/mercury</span></div><div class=""><span style="font-family: APL385;" class="">LDFLAGS=-lcurl</span></div><div class=""><span style="font-family: APL385;" class=""><br class=""></span></div><div class=""><span style="font-family: APL385;" class="">all:: $(BIN)</span></div><div class=""><span style="font-family: APL385;" class=""><br class=""></span></div><div class=""><span style="font-family: APL385;" class="">install:: $(BIN)</span></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>mv -f -v $(BIN) $(HOME)/bin/</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">%: %.m $(DEPS)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>mmc $(FLAGS) --make $@</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">$(BIN): $(DEPS)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>mmc $(FLAGS) $(LDFLAGS) $(CURL_LIB) --make $(BIN)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>mv -fv $(BIN) $(BIN)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class="">clean::</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>rm -rf Mercury</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>rm -fv $$(for x in $(FILES); do echo $$x.{$(GENEXT)}; done)</span></font></div><div class=""><font face="APL385" class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>rm -fv $(BIN)</span></font></div></div><div class=""><br class=""></div><div class="">:)</div><div class=""><br class=""></div><div class="">All the best,</div><div class="">Sean.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>