Re: [sqlite] Windows dll - Export Symbol

2019-03-27 Thread Larry Brasfield
Keith Medcalf, (quoting Llyod), writes:

>> >How can I build the dll correctly?

> cl -DSQLITE_API=__declspec(dllexport) sqlite3.c -link -dll -out:sqlite3.dll



I do not claim here that “correctly” building the DLL must be done as
either I or Keith has suggested.  However, the method using Makefile.msc
accomplishes a few things that the do-it-all-almost CL invocation does
not.  For example, it compiles sqlite3.rc as a resource source and causes
information such as the file version, source id, copyright, etc. to be
linked into the DLL as a resource.  (This can be seen in Windows file
explorer by right-clicking on the DLL, clicking the “Properties” button,
then clicking the “Details” tab.)



With either method, it is possible to set a great many compile options.
The makefile has provisions for setting them in a consistent way.  And as
‘make’ aficionados know, it is a very convenient place to keep track of and
reuse how you want to build something.



That said, standalone CL invocation is great for just getting something
made quickly when bothering with more files is just excess bother.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Windows dll - Export Symbol

2019-03-27 Thread Keith Medcalf

On Wednesday, 27 March, 2019 07:18, Lloyd  wrote:

>I wish to build SQLite as a dll in Windows. As per the documentation
>here
>https://www.sqlite.org/howtocompile.html, I have executed the command
>cl sqlite3.c -link -dll -out:sqlite3.dll
>on Visual Studio x86 command prompt.

>It seems that the dll built doesn't export any symbols! I checked it
>using the dumpbin utility. But the dll downloaded from www.sqlite.org
>exports symbols.

>How can I build the dll correctly?

cl -DSQLITE_API=__declspec(dllexport) sqlite3.c -link -dll -out:sqlite3.dll

which will define the SQLITE_API as being dllexport entries so that MSVC will 
export them.  Or you can input a .def file to the linker with the name of the 
symbols to export.  Unlike "-shared" on *nix, the linker does not export 
entrypoints unless told to do so.

The above command should yield the .dll and the .lib import library.  If you 
also get a .manifest then you need to attach it to the .dll using the mt 
command thusly:

mt -nologo -manifest SQLite3.dll.manifest -outputresource:SQLite3.dll;2

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.





___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Windows dll - Export Symbol

2019-03-27 Thread Larry Brasfield
Lloyd writes:
I wish to build SQLite as a dll in Windows. As per the documentation here
https://www.sqlite.org/howtocompile.html, I have executed the command
cl sqlite3.c -link -dll -out:sqlite3.dll
on Visual Studio x86 command prompt.

It seems that the dll built doesn't export any symbols! I checked it using
the dumpbin utility. But the dll downloaded from www.sqlite.org exports
symbols.

How can I build the dll correctly?

The project publishes a file, Makefile.msc, which is written in the language 
understood by NMAKE.exe, (which ships with Visual Studio.)  It defines a 
target, ‘dll’ (sans quotes), recipe for which builds the DLL you want.  You 
could either study that file to see the relevant flags for CL.exe (and LINK.exe 
and a couple other tools), or you could invoke NMAKE in a command-line shell 
thusly:
nmake -f Makefile.msc dll
For the latter, you would first run the VS batch file that sets the environment 
so those tools can find necessary files.

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Windows dll - Export Symbol

2019-03-27 Thread Lloyd
Hi,

I wish to build SQLite as a dll in Windows. As per the documentation here
https://www.sqlite.org/howtocompile.html, I have executed the command
cl sqlite3.c -link -dll -out:sqlite3.dll
on Visual Studio x86 command prompt.

It seems that the dll built doesn't export any symbols! I checked it using
the dumpbin utility. But the dll downloaded from www.sqlite.org exports
symbols.

How can I build the dll correctly?

Thanks,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users