0

I have a sqlite extension file. The source is sqliteext/csv.c. When I build the lib with clang the output file is created at lib/csv.so.

cc -g -fPIC -I /usr/local/include -shared sqliteext/csv.c -o lib/csv.so

When I compile the lib using zig...

zig build-lib -I /usr/local/include -I /usr/include -I /usr/include/x86_64-linux-gnu --c-source sqliteext/csv.c -dynamic --output-dir lib

There are two problems.

  • zig prefixes the filename with a lib
  • zig add a version number thing in the suffix

so the output file is lib/libcsv.so.0.0.0

And what's interesting about this is that I need to change the filename in my extension loader (that's ok) but that I also need a symlink to handle the 0.0.0.

I'm still looking at the CLI help but I'm still not seeing the thing I need.

Richard
  • 10,122
  • 10
  • 42
  • 61

1 Answers1

2

See https://github.com/ziglang/zig/issues/2230 and https://github.com/ziglang/zig/issues/2231

The former was fixed the same day as your post via https://github.com/ziglang/zig/pull/6315

daurnimator
  • 4,091
  • 18
  • 34
  • I guess this is good enough to say that this is still under development. In my case they also added the 0.0.0 and that meant I needed to add a bare symlink – Richard Sep 13 '20 at 13:25