You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
project('shared module linked to symbol in executable', 'c')
dl =meson.get_compiler('c').find_library('dl', required : false)
m =shared_module('module', 'module.c')
e =executable('prog', 'prog.c', dependencies : dl)
test('test', e, args: m)
Further to the discussion in PR #1567 consider this example
meson.build
prog.c
module.c
This fails to build on Windows, because func_from_executable() can't be resolved at link time (as is required by PE/COFF):
However, I can write the following Makefile which builds it successfully. Note the use of libprog.exe.a.
Makefile
all: $(CC) $(CFLAGS) -o module.o -c module.c $(CC) $(CFLAGS) -o prog.o -c prog.c $(CC) $(CFLAGS) -o prog.exe prog.o -Wl,--export-all,--out-implib,libprog.exe.a $(CC) $(CFLAGS) -o cygmodule.dll module.o libprog.exe.a -shared -Wl,-soname,cygmodule.dll -Wl,--out-implib=libmodule.dll.a
The text was updated successfully, but these errors were encountered: