Thank you for the pexports recommendation.
For somebody that just read this problem for the first time, a summary:
Emacs version: GNU Emacs 25.1.1
Build process: mingw64_shell.bat (Windows)
Dependency: sqlite.lib
Makefile:
EMACS = D:\user\emacs-src\emacs-25-branch-src
INCLUDE = -I. -I$(EMACS)\src
CC = gcc
LD = gcc
LDFLAGS =
# On MS-Windows, say "make SO=dll" to build the module
SO = dll
# -fPIC is a no-op on Windows, but causes a compiler warning
ifeq ($(SO),dll)
CFLAGS = -std=gnu99 -ggdb3 -Wall
else
CFLAGS = -std=gnu99 -ggdb3 -Wall -fPIC
endif
all: sqlite3-core.$(SO)
%.$(SO): %.o
$(LD) -shared $(LDFLAGS) -o $@ $< sqlite3.lib
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE) -c $<
check:
$(EMACS)/src/emacs -batch -l ert -l test.el -f ert-run-tests-batch-and-exit
clean:
rm -rf *.o *.dll *.a *.d
--------------------------------------------------------------------------------------------------------------------------------
Now the result of my tests:
1. The symbols exported by the modules without considering any sqlite function are:
LIBRARY sqlite3-core.dll
EXPORTS
emacs_module_init ; .text ; RVA 00001685
plugin_is_GPL_compatible DATA ; no section ; RVA 00007010
2. onsidering the following sqlite3 related function:
static void
el_sqlite3_free(void *arg)
{
sqlite3_close((sqlite3*)arg);
}
When I generate the sqlite3-core.dll using at least one sqlite3 DLL function, for example sqlite3_close , an error message appears: (the module can't be found)
..../modules/emacs-sqlite3/sqlite3-core.dll: Das angegebene Modul wurde nicht gefunden.
I check the sqlite3.dll using pexports tool, and the symbols sqlite3_close is exported.
LIBRARY sqlite3.dll
EXPORTS
.....
sqlite3_changes ; .text ; RVA 0009c648
sqlite3_clear_bindings ; .text ; RVA 000373dc
sqlite3_close ; .text ; RVA 0009c9e8
sqlite3_close_v2 ; .text ; RVA 0009ca08
sqlite3_collation_needed ; .text ; RVA 0009f4b3
sqlite3_collation_needed16 ; .text ; RVA 0009f51f
I check the module qlite3-core.dll again and the symbols are there.
; .text : RVA: 00001000, File offset: 00000600
; .data : RVA: 00003000, File offset: 00002400
; .rdata : RVA: 00004000, File offset: 00002600
; .pdata : RVA: 00005000, File offset: 00002e00
; .xdata : RVA: 00006000, File offset: 00003200
; .bss : RVA: 00007000, File offset: 00000000
; .edata : RVA: 00008000, File offset: 00003400
; .idata : RVA: 00009000, File offset: 00003600
; .CRT : RVA: 0000a000, File offset: 00003e00
; .tls : RVA: 0000b000, File offset: 00004000
; .reloc : RVA: 0000c000, File offset: 00004200
; /4 : RVA: 0000d000, File offset: 00004400
; /19 : RVA: 0000e000, File offset: 00004800
; /31 : RVA: 00018000, File offset: 0000e200
; /45 : RVA: 0001a000, File offset: 0000fa00
; /57 : RVA: 0001c000, File offset: 00011200
; /70 : RVA: 0001d000, File offset: 00011e00
; /81 : RVA: 0001e000, File offset: 00012200
; /92 : RVA: 00021000, File offset: 00015200
; /105 : RVA: 0002b000, File offset: 0001f200
; Reading exports from section: .edata
; Export table: sqlite3-core.dll
; Ordinal base: 1
; Ordinal table RVA: 00008038
; Name table RVA: 0008030
; Export address table RVA: 00008028
LIBRARY sqlite3-core.dll
EXPORTS
emacs_module_init ; .text ; RVA 00001696
plugin_is_GPL_compatible DATA ; no section ; RVA 000078f0
Please, notice that this time the plugin_is_GPL_compatible. The problem is now that the module can't be found when a sqlite3.dll symbol is used.
Any Idea or suggestion?
Thanks
Levis