-m64 means generate 64-bit code.  If you want 32-bit use -m32
-mwin32 means that the compilation is for windows.  If it is not for Windows, 
omit this.
-mdll means to compile/link as a DLL
The SQLITE_API=... define adds the necessary attribute to export the API on 
windows.
-mthreads tells the compiler to use threadsafe code and libraries
The SQLITE_HAS_CODEC define enables the SEE hooks
-Wl,-Bstatic tells the linker to link using the static versions of the library's
--nxcompat,--dynamicbase mean what they say and are instructions to the linker 
for Windows
-static-libgc tells the compiler to statically link the gcc c runtime into the 
DLL

gcc -m64 -s -O3 -mwin32 -pipe -mdll -Wl,-Bstatic,--nxcompat,--dynamicbase 
-DSQLITE_API=__declspec(dllexport) -mthreads -DSQLITE_HAS_CODEC=1 
see_sqlite3x.c   -o see_sqlite3.dll 
-Wl,--output-def,see_sqlite3.def,--out-implib,libssee_sqlite3.dll.a 
-static-libgc

compiles a "C" file called "see_sqlite3.c" and creates "see_sqlite3.dll", 
"see_sqlite3.def", and "libsee_sqlite3.a"

lib /nologo /machine:x86 /def:see_sqlite3.def

generates a Windows .lib file from the .def file for use with Windows compilers 
that need the .lib format rather than the .a format libraries used by GCC.

You will get the following files:
 see_sqlite3.c -- input source code
 see_sqlite3.dll -- output dynamic link library
 see_sqlite3.lib -- output lib format library to import the dll entry points
 libsee_sqlite3.dll.a -- output a format library to create the trampolines for 
GCC

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


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of J Decker
>Sent: Friday, 20 July, 2018 12:13
>To: General Discussion of SQLite Database
>Subject: Re: [sqlite] Issue using SEE
>
>On Fri, Jul 20, 2018 at 11:05 AM Keith Medcalf <kmedc...@dessus.com>
>wrote:
>
>>
>> Firstly, the SQLITE_DLL define does not exist (is this a bug in the
>docs>?
>> Secondly you did not define SQLITE_HAS_CODEC as required to
>integrate the
>> SEE codec/
>> Thirdly a .dll file cannot be created with ar.  ar is for creating
>> libraries, not DLLs. (.a files)
>>
>> To statically link you should just add the see_sqlite3.c file to
>your
>> project making sure you define SQLITE_HAS_CODEC
>>
>> Or do you really want a dynamically linked DLL?
>>
>It would be a dll... but you missed the more mportant point
>
>This generates “see-sqlite3.dll” but for some reason when I am trying
>to
>add this dll as a reference its throwing error "see-sqlite3.dll is
>not a
>valid .Net assembly ".
>
>that it needs to be built as system.data.sqlite is.... not just a
>dll.
>
>
>>
>> ---
>> The fact that there's a Highway to Hell but only a Stairway to
>Heaven says
>> a lot about anticipated traffic volume.
>>
>>
>> >-----Original Message-----
>> >From: sqlite-users [mailto:sqlite-users-
>> >boun...@mailinglists.sqlite.org] On Behalf Of sudeep singh
>> >Sent: Friday, 20 July, 2018 11:52
>> >To: sqlite-users@mailinglists.sqlite.org
>> >Subject: [sqlite] Issue using SEE
>> >
>> >Hi Team,
>> >
>> >We have recently purchased SEE subscription to encrypt our data in
>> >mobile.
>> >Our application supports iOS, android and windows(UWP).  We used
>> >Xamarin
>> >forms(.net standard2) approach to build this application which
>> >supports c#
>> >language. We are following this link
>> >https://www.sqlite.org/see/doc/trunk/www/readme.wiki where they
>have
>> >guided
>> >how to compile and use SEE.
>> >
>> >Basically we are trying to use this SQLITE as a dll and to do so
>we
>> >ran
>> >below command in mac
>> >
>> >    cat sqlite3.c see.c >see-sqlite3.c
>> >
>> >    gcc -c -DSQLITE_DLL=1 see-sqlite3.c
>> >
>> >    ar a see-sqlite3.dll see-sqlite3.o
>> >
>> >
>> >
>> >
>> >
>> >This generates “see-sqlite3.dll” but for some reason when I am
>trying
>> >to
>> >add this dll as a reference its throwing error "see-sqlite3.dll is
>> >not a
>> >valid .Net assembly ".
>> >
>> >Any help will be really appreciated.
>> >_______________________________________________
>> >sqlite-users mailing list
>> >sqlite-users@mailinglists.sqlite.org
>> >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
>users
>>
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
>users
>>
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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

Reply via email to