From: "MyCo (Maik Menz) via ruby-core" Date: 2023-07-06T01:47:00+00:00 Subject: [ruby-core:114099] [Ruby master Misc#19758] Statically link ext/json Issue #19758 has been updated by MyCo (Maik Menz). The problem appears to be here: ``` $(LIBRUBY_A): $(OBJS) $(INITOBJS) $(ECHO) linking static-library $(@:\=/) $(Q) $(AR) $(ARFLAGS)$@ $(OBJS) $(INITOBJS) ``` where: ``` INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT) ``` This should actually point to `ext/extinit.$(OBJEXT) enc/encinit.$(OBJEXT)` but no matter what I try, it's always creating build issues. For example `No such file or directory @ rb_sysopen - ext/extinit.c`, maybe someone can give me a hint what's going on. I don't understand how this file doesn't exist even if it's a dependency of a build step. ---------------------------------------- Misc #19758: Statically link ext/json https://bugs.ruby-lang.org/issues/19758#change-103775 * Author: MyCo (Maik Menz) * Status: Open * Priority: Normal ---------------------------------------- Hi, I'm building Ruby both as dynamic and static library with MSVC for a project. Everything appears to work fine, but now I'm trying to use the json ext, and it only works with the dynamically linked version. In the statically linked version it says it's missing json/pure but on closer inspection the reason it says that is because it can't find json/ext/parser (and probably also json/ext/generator) in the first place. I can see that both parser & generator created static libs in the build directory but they aren't linked into the ruby lib. With my limited knowledge of the building processes, my first attempt was to add both of those libs into `LOCAL_LIBS` and now they apear in the linking process. But this still doesn't change anything. It's still not finding those 2 libs in the statically linked Ruby build. What am I missing? What do I have to do, to get those linked into the static lib? Regards Maik -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/