Compile wcecompat to dll

I use wcecompat to bridge the gap between the WinCE SDK and OpenSSL. Due to a problem with the LGPL license, I want to compile it into a dynamically linked library. Here is the part of the makefile (the full file is located at https://github.com/mauricek/wcecompat/blob/master/makefile ). My question is how to change it to build a dll instead of a static lib?

all: lib\wcecompat.lib lib\wcecompatex.lib echo $(OBJS) obj: @md obj 2> NUL lib: @md lib 2> NUL $(OBJS): makefile obj lib\wcecompat.lib: lib $(OBJS) makefile @lib /nologo /out:lib\wcecompat.lib $(LFLAGS) $(OBJS) lib\wcecompatex.lib: lib $(OBJS) makefile @lib /nologo /out:lib\wcecompatex.lib $(OB 

Js)

+4
source share
1 answer

Use link (i.e. link.exe) instead of lib for two purposes:

 lib\wcecompat.lib: lib $(OBJS) makefile @lib /nologo /out:lib\wcecompat.lib $(LFLAGS) $(OBJS) lib\wcecompatex.lib: lib $(OBJS) makefile @lib /nologo /out:lib\wcecompatex.lib $(OBJS) 

... and rename the targets to wcecompat.dll and wcecompatex.dll respectively.

However, it does help you in creating the DLL, but it does not contain any changes to export the functions that you might need from this DLL. Also remember that dlls with code have a DllMain function as an entry point (although it is not exported as such).

+1
source

Source: https://habr.com/ru/post/1336898/


All Articles